package com.siwei.mes.service.laboratory.impl;


import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.siwei.mes.common.util.*;
import com.siwei.mes.entity.UploadLaboratoryEntity;
import com.siwei.mes.entity.ShxhSynchronizedata;
import com.siwei.mes.entity.experiment.CheckBatchConfig;
import com.siwei.mes.entity.experiment.Experiment;
import com.siwei.mes.entity.experiment.ExperimentDetail;
import com.siwei.mes.entity.experiment.cement.*;
import com.siwei.mes.entity.experiment.coarseAggregate.*;
import com.siwei.mes.entity.experiment.concrete.batch.ConcreteKsdj;
import com.siwei.mes.entity.experiment.concrete.batch.ConcreteKyqd;
import com.siwei.mes.entity.experiment.concrete.batch.ConcreteKzqd;
import com.siwei.mes.entity.experiment.concreteAdmixture.*;
import com.siwei.mes.entity.experiment.fineAggregate.*;
import com.siwei.mes.entity.experiment.flyAsk.*;
import com.siwei.mes.entity.experiment.slag.*;
import com.siwei.mes.entity.laboratory.*;
import com.siwei.mes.entity.laboratory.cement.DataSnAdx;
import com.siwei.mes.entity.laboratory.cement.DataSnBZCD_NJSJ;
import com.siwei.mes.entity.laboratory.cement.DataSnBbmj;
import com.siwei.mes.entity.laboratory.cement.DataSnXd;
import com.siwei.mes.entity.laboratory.coarseAggregate.*;
import com.siwei.mes.entity.laboratory.concrete.DataConcreteKs;
import com.siwei.mes.entity.laboratory.concrete.DataConcreteKsk;
import com.siwei.mes.entity.laboratory.concrete.DataConcreteKy;
import com.siwei.mes.entity.laboratory.concrete.DataConcreteKz;
import com.siwei.mes.entity.laboratory.concreteAdmixture.*;
import com.siwei.mes.entity.laboratory.fineAggregate.*;
import com.siwei.mes.entity.laboratory.fly.DataFlyAdx;
import com.siwei.mes.entity.laboratory.fly.DataFlyHsl;
import com.siwei.mes.entity.laboratory.fly.DataFlyXslb;
import com.siwei.mes.entity.laboratory.slag.DataSlagHsl;
import com.siwei.mes.entity.laboratory.slag.DataSlagLddb;
import com.siwei.mes.entity.laboratory.slag.DataSlagMd;
import com.siwei.mes.entity.laboratory.slag.DataSlagSsl;
import com.siwei.mes.entity.system.TestProjectInfo;
import com.siwei.mes.entity.system.TestProjectSpecConfig;
import com.siwei.mes.enums.*;
import com.siwei.mes.enums.laboratory.ReportIdEnum;
import com.siwei.mes.mapper.ShxhSynchronizedataMapper;
import com.siwei.mes.mapper.experiment.CheckBatchConfigMapper;
import com.siwei.mes.mapper.experiment.ExperimentDetailMapper;
import com.siwei.mes.mapper.experiment.ExperimentMapper;
import com.siwei.mes.mapper.laboratory.*;
import com.siwei.mes.mapper.system.TestProjectInfoMapper;
import com.siwei.mes.mapper.system.TestProjectSpecConfigMapper;
import com.siwei.mes.service.laboratory.DownloadLaboratoryService;
import com.siwei.mes.service.laboratory.FinishLaboratoryService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;

import static com.siwei.mes.common.exception.handler.MessageHandler.assertTrue;

public class FinishLaboratoryServiceImplBefore implements FinishLaboratoryService {
    private static final Logger log = LoggerFactory.getLogger("laboratory");
    @Resource
    private ExperimentMapper experimentMapper;
    @Resource
    private ExperimentDetailMapper experimentDetailMapper;
    @Resource
    private CementLaboratoryMapper m_cementLaboratoryMapper;
    @Resource
    private ShxhSynchronizedataMapper shxhSynchronizedataMapper;
    @Resource
    private CheckBatchConfigMapper checkBatchConfigMapper;
    @Resource
    private FlyAshLaboratoryMapper flyAshLaboratoryMapper;
    @Resource
    private SlagLaboratoryMapper slagLaboratoryMapper;
    @Resource
    private AdmixtureLaboratoryMapper admixtureLaboratoryMapper;
    @Resource
    private CoarseLaboratoryMapper coarseLaboratoryMapper;
    @Resource
    private FineLaboratoryMapper fineLaboratoryMapper;
    @Resource
    private WTSampleMapper wtSampleMapper;
    @Resource
    private ImportListMapper importListMapper;
    @Resource
    private WTConsignMapper wtConsignMapper;
    @Resource
    private ConcreteLaboratoryMapper concreteLaboratoryMapper;
    @Resource
    private TestProjectInfoMapper testProjectInfoMapper;
    @Resource
    private UploadLaboratoryMapper m_uploadLaboratoryMapper;
    @Resource
    private DataDefUcLaboratoryMapper dataDefUcLaboratoryMapper;
    @Resource
    private PrintReportMapper printReportMapper;
    @Resource
    private DownloadLaboratoryService downloadLaboratory;
    @Resource
    private TestProjectSpecConfigMapper testProjectSpecConfigMapper;
    @Resource
    private KeyPropertyMapper keyPropertyMapper;

    @Override
    public void finishLaboratory(UploadLaboratoryEntity entity) {
        try {
            assertTrue(entity == null || entity.getExperimentId() == null || entity.getExperimentId().isEmpty(), "上传上海协会数据，试验台账id不允许为空！");

            //需要同步的试验台账数据 id
            List<String> experimentId = entity.getExperimentId();

            for (String val : experimentId) {
                //查询品控台账信息
                Experiment experiment = experimentMapper.findExperimentById(Long.parseLong(val));

                //判断序号表是新增还是修改
                boolean isUpdateSn = false;
                PrintReportSerialNumber printReportSerialNumber = new PrintReportSerialNumber();

                PrintReport report = new PrintReport();
                //根据台账 查询品控做的试验项目详情 结果
                List<ExperimentDetail> experimentDetailList = experimentDetailMapper.getList(new ExperimentDetail().setExperimentId(experiment.getId()));

                JSONArray objArray = new JSONArray();
                for (ExperimentDetail experimentDetail : experimentDetailList) {
                    objArray.add(experimentDetail.getObjJson());
                }
                Date jcrq = ExperimentDetail.extractEndDate(objArray);
                String sampleNo;
                //过滤快检业务
                if (experiment.getCheckType() == null || experiment.getCheckType().equals(CheckEnum.QUICK.getCode())) {
                    log.error("不允许同步快检业务... 台账id：" + experiment.getId());
                    throw new RuntimeException("不允许同步快检业务... 台账id：" + experiment.getId());
                }

                //上传试验数据到协会软件
                //混凝土
                if (MaterialsEnum.CONCRETE.getCode().equals(experiment.getExperimentType())) {

                    List<ShxhSynchronizedata> list = shxhSynchronizedataMapper.getList(new ShxhSynchronizedata().setExperimentId(experiment.getId()));
                    if (list.isEmpty() || StringUtils.isBlank(list.get(0).getSampleId())) {
                        log.info("同步协会生成生产任务可能未成功！... 台账id：" + experiment.getId());
                        return;
                    }

                    //查询协会混凝土同步数据
                    ShxhSynchronizedata synchronizedata = list.get(0);

                    //上海协会对应的样品编码
                    sampleNo = synchronizedata.getSampleId();


                    for (ExperimentDetail detail : experimentDetailList) {
                        //判断试验项目是否已做完！
                        if (!concrete(detail, sampleNo)) {
                            continue;
                        }

                        log.info("同步新增混凝土试验项目开始，品控台账id：【{}】，台账编号；【{}】", experiment.getId(), experiment.getExperimentNo());
                        finishConcreteTest(sampleNo, experimentDetailList, experiment);
                        log.info("同步新增混凝土试验项目结束，品控台账id：【{}】，台账编号；【{}】", experiment.getId(), experiment.getExperimentNo());
                    }


                    //品控对应状态为 3 已完成 则更新协会状态
                    if (experiment.getExperimentStatus() != null && "3".equals(experiment.getExperimentStatus().toString())) {
                        //更新协会委托状态
                        String sampleNo1 = synchronizedata.getSampleId();

                        Map<String, Object> wtSampleList = wtSampleMapper.findWTSampleList(sampleNo1);
                        if (wtSampleList == null) {
                            log.error("保存协会数据有误 样品id ：" + sampleNo1);
                            throw new RuntimeException("保存协会数据有误 样品id ：" + sampleNo1);
                        }
                        String status = "";
                        if (wtSampleList.get("Status") != null) {
                            for (String s : wtSampleList.get("Status").toString().split(";")) {
                                status += "1" + ";";
                            }
                        }
                        //更新为已完成
                        wtSampleMapper.updateWTSampleList(sampleNo1, status, "1", experiment.getConclusion());

                        //修改协会对应关系
                        synchronizedata.setFinistStatus("1");
                        shxhSynchronizedataMapper.updateByPrimaryKeySelective(synchronizedata);

                    }
                    String reportNo = "";
                    for (ExperimentDetail detail : experimentDetailList) {
                        //抗压强度
                        if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KYQD.getCode())) {
                            reportNo = ReportIdEnum.CONCRETE_HKY.getNo();
                        } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KSDJ.getCode())) {
                            reportNo = ReportIdEnum.CONCRETE_HKS.getNo();
                        } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KZQD.getCode())) {
                            reportNo = ReportIdEnum.CONCRETE_HKZ.getNo();
                        }
                    }
                    //查询协会是否存在实验台帐报表信息，不存在新增
                    PrintReport printReport;
                    if (StringUtils.isNotEmpty(synchronizedata.getConsignId())) {
                        printReport = printReportMapper.queryByConSignID(synchronizedata.getConsignId());
                        if (printReport == null && StringUtils.isNotEmpty(reportNo)) {
                            Map<String, Object> wtSampleList = wtSampleMapper.findWTSampleList(synchronizedata.getSampleId());
                            if (wtSampleList != null) {
                                //新增Print_Report表
                                String reportId = "";
                                Integer currentSN;
                                /**查询最新一条数据**/
                                printReportSerialNumber = printReportMapper.queryReportSerialNumberByItemID(wtSampleList.get("ItemID").toString());
                                if (printReportSerialNumber == null) {
                                    printReportSerialNumber = new PrintReportSerialNumber();
                                    printReportSerialNumber.setCurrentSN(0);
                                    printReportSerialNumber.setItemID((Integer) wtSampleList.get("ItemID"));
                                    printReportSerialNumber.setCurrentYear(DateHelper.getYear());
                                    printReportSerialNumber.setPreName(reportNo);
                                    reportId = reportNo + DateHelper.getYear() + "00001";
                                } else {
                                    currentSN = printReportSerialNumber.getCurrentSN();
                                    int maxId = currentSN + 1;
                                    String currentNumber = String.format("%05d", maxId);
                                    printReportSerialNumber.setCurrentSN(maxId);
                                    isUpdateSn = true;
                                    reportId = reportNo + DateHelper.getYear() + currentNumber;
                                }
                                if (wtSampleList != null) {
                                    report.setKindID(wtSampleList.get("KindID").toString());
                                    report.setItemID(wtSampleList.get("ItemID").toString());
                                    report.setConSignID(synchronizedata.getConsignId());
                                    report.setReportID(reportId);
                                    report.setImportId(synchronizedata.getImportId());
                                }
                            }
                        }
                    }

                } else {
                    //原材料
                    //查询是否同步进料
                    List<ShxhSynchronizedata> list = shxhSynchronizedataMapper.getList(new ShxhSynchronizedata().setExperimentId(experiment.getId()));

                    if (list.isEmpty() || list.get(0).getSampleNo() == null || list.get(0).getImportId() == null || list.get(0).getConsignId() == null
                            || list.get(0).getSampleId() == null) {
                        log.info("同步协会生成进料/台账/取样可能未成功！... 台账id：" + experiment.getId());
                        return;
                    }
                    //查询协会进料id
                    ShxhSynchronizedata synchronizedata1 = list.get(0);

                    //上海协会对应的样品编码
                    sampleNo = synchronizedata1.getSampleId();

                    //根据进料id查询进料数据
                    List<String> stringList = new ArrayList<>();
                    stringList.add(synchronizedata1.getImportId());
                    List<ImportList> mapList = importListMapper.findImportListById(stringList);

                    if (mapList.isEmpty() || mapList.size() == 0 || StringUtils.isBlank(mapList.get(0).getSampleID())) {
                        log.error("根据进料id未查询到进料数据/进料规格为空！进料id : " + synchronizedata1.getImportId());
                        throw new RuntimeException("根据进料id未查询到进料数据/进料规格为空！进料id : " + synchronizedata1.getImportId());
                    }
                    String samId = mapList.get(0).getSampleID();

                    log.info("同步新增原材料试验项目开始，品控台账id：【{}】，台账编号；【{}】", experiment.getId(), experiment.getExperimentNo());
                    //如果为水泥
                    if (MaterialsEnum.CEMENT.getCode().equals(experiment.getExperimentType())) {
                        finishCementTest(sampleNo, experimentDetailList, experiment, samId);
                    } else if (MaterialsEnum.FLY.getCode().equals(experiment.getExperimentType())) {
                        finishFlyTest(sampleNo, experimentDetailList, experiment, samId);
                    } else if (MaterialsEnum.SLAG.getCode().equals(experiment.getExperimentType())) {
                        finishSlagTest(sampleNo, experimentDetailList, experiment, samId);
                    } else if (MaterialsEnum.COARSE.getCode().equals(experiment.getExperimentType())) {
                        finishCoarseTest(sampleNo, experimentDetailList, experiment, samId);
                    } else if (MaterialsEnum.FINE.getCode().equals(experiment.getExperimentType())) {
                        finishFineTest(sampleNo, experimentDetailList, experiment, samId);
                    } else if (MaterialsEnum.ADMIXTURE.getCode().equals(experiment.getExperimentType())) {
                        finishAdmixtureTest(sampleNo, experimentDetailList, experiment, samId);
                    } else {
                        log.error("同步协会试验结果 未知的材料类型！... 台账id：" + experiment.getId() + "材料类型=" + experiment.getExperimentType());
                        throw new RuntimeException("同步协会试验结果 未知的材料类型！... 台账id：" + experiment.getId() + "材料类型=" + experiment.getExperimentType());
                    }
                    log.info("同步新增原材料试验项目结束，品控台账id：【{}】，台账编号；【{}】", experiment.getId(), experiment.getExperimentNo());

                    //品控对应状态为 3 已完成 则更新协会状态
                    if (experiment.getExperimentStatus() != null && "3".equals(experiment.getExperimentStatus().toString())) {
                        //更新协会委托状态
                        String sampleNo1 = synchronizedata1.getSampleNo();

                        Map<String, Object> wtSampleList = wtSampleMapper.findWTSampleList(sampleNo1);
                        if (wtSampleList == null) {
                            log.error("保存协会数据有误 样品id ：" + sampleNo1);
                            throw new RuntimeException("保存协会数据有误 样品id ：" + sampleNo1);
                        }
                        String status = "";
                        if (wtSampleList.get("Status") != null) {
                            for (String s : wtSampleList.get("Status").toString().split(";")) {
                                status += "1" + ";";
                            }
                        }
                        //更新为已完成
                        wtSampleMapper.updateWTSampleList(sampleNo1, status, "1", experiment.getConclusion());
                        //修改协会对应关系
                        synchronizedata1.setFinistStatus("1");
                        shxhSynchronizedataMapper.updateByPrimaryKeySelective(synchronizedata1);

                    }
                    String reportId = "";

                    //查询协会是否存在实验台帐报表信息，不存在新增
                    PrintReport printReport;
                    if (StringUtils.isNotEmpty(synchronizedata1.getConsignId())) {
                        printReport = printReportMapper.queryByConSignID(synchronizedata1.getConsignId());
                        String reportNo = ReportIdEnum.selectByCode(experiment.getExperimentType()).getNo();

                        report.setConSignID(synchronizedata1.getConsignId());
                        report.setImportId(synchronizedata1.getImportId());
                        report.setKindID(mapList.get(0).getKindId());
                        report.setItemID(mapList.get(0).getItemId());

                        if (printReport == null && StringUtils.isNotEmpty(reportNo)) {
                            Integer currentSN;
                            /**查询最新一条数据**/
                            printReportSerialNumber = printReportMapper.queryReportSerialNumberByItemID(report.getItemID());
                            if (printReportSerialNumber == null) {
                                printReportSerialNumber = new PrintReportSerialNumber();
                                printReportSerialNumber.setCurrentSN(0);
                                printReportSerialNumber.setItemID(Integer.valueOf(report.getItemID()));
                                printReportSerialNumber.setCurrentYear(DateHelper.getYear());
                                printReportSerialNumber.setPreName(reportNo);
                                reportId = reportNo + DateHelper.getYear() + "00001";
                            } else {
                                currentSN = printReportSerialNumber.getCurrentSN();
                                int maxId = currentSN + 1;
                                String currentNumber = String.format("%05d", maxId);
                                printReportSerialNumber.setCurrentSN(maxId);
                                isUpdateSn = true;
                                reportId = reportNo + DateHelper.getYear() + currentNumber;
                            }
                            report.setReportID(reportId);
                        } else {
                            report.setReportID(printReport.getReportID());
                        }
                    }
                }
                //** 水泥试验，如果做了凝结时间、安定性、标准稠度、就往printreport表及有关表插入条数据**/
                boolean isSnFlag = MaterialsEnum.CEMENT.getCode().equals(experiment.getExperimentType()) ? isSnTestPojector(experimentDetailList) : false;
                /**只有已完成的试验台账才生成**/
                if (ObjectUtil.isNotEmpty(report.getReportID()) && ExperimentStatusEnum.FINISH.getCode().equals(experiment.getExperimentStatus())) {
                    /**插入协会报表表**/
                    savePrintReport(report, experiment, jcrq, isUpdateSn, printReportSerialNumber);

                    //更新协会wt 报告编号
                    wtConsignMapper.updateWtConsign(report.getReportID(), report.getConSignID(), experiment.getConclusion());

                    //更新协会wt 报告编号
                    importListMapper.updateImportListReportID(report.getReportID(), report.getImportId());
                    //更新协会入场时间
                    if (!MaterialsEnum.CONCRETE.getCode().equals(experiment.getExperimentType()) && experiment.getAdmissionTime() != null) {
                        importListMapper.updateImportDateListReportID(experiment.getAdmissionTime(), report.getImportId());
                    }

                    List<String> stringList = new ArrayList<>();
                    stringList.add(val);

                    UploadLaboratoryEntity UploadLaboratoryEntity = new UploadLaboratoryEntity().setExptId(experiment.getId()).setExperimentId(stringList);

                    //下载协会报告等信息
                    downloadLaboratory.downloadReportLaboratory(UploadLaboratoryEntity);

                    log.info("开始操作协会【print_examrecord】表数据");
                    //保存打印记录表
                    PrintExamRecord printExamRecordOld = printReportMapper.queryBySampleID(sampleNo, report.getConSignID());
                    PrintExamRecord printExamRecord = new PrintExamRecord();
                    printExamRecord.setKindID(report.getKindID());
                    printExamRecord.setItemID(report.getItemID());
                    printExamRecord.setConSignID(report.getConSignID());
                    printExamRecord.setSampleID(sampleNo);
                    printExamRecord.setExamPerson(experiment.getSocietyUserName());
                    printExamRecord.setExamTime(jcrq);
                    printExamRecord.setPrintStatus("0");
                    printExamRecord.setReportApproval("1");
                    printExamRecord.setReportApprovalLoginType("0");
                    printExamRecord.setReportApprovalTime(jcrq);
                    printExamRecord.setUploadFlag(UploadFlagUtils.CtoGB_Num(sampleNo, "z", new Date(), null));
                    if (printExamRecordOld == null) {
                        printReportMapper.insertPrintExamRecord(printExamRecord);
                    } /*李总确认目前只新增，不修改else {
                        printExamRecord.setID(printExamRecordOld.getID());
                        printReportMapper.updatePrintExamRecord(printExamRecord);
                    }*/
                    log.info("操作协会【print_examrecord】表成功，入参：【{}】", JsonUtils.getJson(printExamRecord));
                } else if (isSnFlag) {
                    /**插入协会报表表**/
                    savePrintReport(report, experiment, jcrq, isUpdateSn, printReportSerialNumber);

                    //更新协会wt 报告编号
                    wtConsignMapper.updateWtConsign(report.getReportID(), report.getConSignID(), experiment.getConclusion());

                    //更新协会wt 报告编号
                    importListMapper.updateImportListReportID(report.getReportID(), report.getImportId());
                    //更新协会入场时间
                    if (!MaterialsEnum.CONCRETE.getCode().equals(experiment.getExperimentType()) && experiment.getAdmissionTime() != null) {
                        importListMapper.updateImportDateListReportID(experiment.getAdmissionTime(), report.getImportId());
                    }

                    List<String> stringList = new ArrayList<>();
                    stringList.add(val);

                    UploadLaboratoryEntity UploadLaboratoryEntity = new UploadLaboratoryEntity().setExptId(experiment.getId()).setExperimentId(stringList);

                    //下载协会报告等信息
                    downloadLaboratory.downloadReportLaboratory(UploadLaboratoryEntity);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException("保存/完成台账试验结果上传协会失败" + e.getMessage());
        }
    }


    //混凝土
    private boolean concrete(ExperimentDetail detail, String sampleNo) {
        JSONObject objJson = detail.getObjJson();
        Map<String, Object> wtSampleList = wtSampleMapper.findWTSampleList(sampleNo);
        //抗压强度
        if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KYQD.getCode())) {
            ConcreteKyqd concreteKyqd = objJson.toJavaObject(ConcreteKyqd.class);
            if (concreteKyqd != null && StringUtils.isNotBlank(concreteKyqd.getPjz7d()) && StringUtils.isNotBlank(concreteKyqd.getPjz28d())
                    && !"0.00".equals(concreteKyqd.getPjz7d()) && !"0.00".equals(concreteKyqd.getPjz28d())) {
                if(wtSampleList != null && wtSampleList.get("Sample_Status") != null && "1".equals(wtSampleList.get("Sample_Status").toString())){
                }else {
                    wtSampleMapper.updateWTSample(sampleNo, "2");
                }
                return true;
            }
            //抗渗等级
        } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KSDJ.getCode())) {

            ConcreteKsdj concreteKsdj = objJson.toJavaObject(ConcreteKsdj.class);
            if (concreteKsdj != null && !concreteKsdj.getKsInfo().isEmpty() && StringUtils.isNotBlank(concreteKsdj.getKsInfo().get(0).getSyyl())) {
                if(wtSampleList != null && wtSampleList.get("Sample_Status") != null && "1".equals(wtSampleList.get("Sample_Status").toString())){
                }else {
                    wtSampleMapper.updateWTSample(sampleNo, "2");
                }
            }
            return true;
            //抗折强度
        } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KZQD.getCode())) {
            ConcreteKzqd concreteKzqd = objJson.toJavaObject(ConcreteKzqd.class);
            if (concreteKzqd != null && StringUtils.isNotBlank(concreteKzqd.getPjz())
                    && !"0.00".equals(concreteKzqd.getPjz())) {
                if(wtSampleList != null && wtSampleList.get("Sample_Status") != null && "1".equals(wtSampleList.get("Sample_Status").toString())){
                }else {
                    wtSampleMapper.updateWTSample(sampleNo, "2");
                }
            }

            return true;
        }

        return false;
    }

    private void savePrintReport(PrintReport report, Experiment experiment, Date jcrq, boolean isUpdateSn, PrintReportSerialNumber printReportSerialNumber) {
        log.info("开始操作协会【Print_Report】表数据");
        /** 所有的原材料报告，报告日期为最后一天检测日期 **/
        Date reportDate = experiment.getExperimentType() == 7 ? new Date() : jcrq;
        if (isUpdateSn) {
            printReportMapper.updateReportSerialNumber(printReportSerialNumber);
        } else {
            printReportMapper.insertReportSerialNumber(printReportSerialNumber);
        }
        /**暂定验证码生成规则为 itemId+1442+四位随机数+四个空格 **/
        report.setIdentifyingCode(report.getItemID() + "1442" + new Random().nextInt(9000) + "    ");
        report.setReportCreateDate(jcrq);
        report.setReportAuditTime(jcrq);
        report.setReportCreateTime(new Date());
        report.setReportCreatePerson(experiment.getSocietyUserName());
        report.setProjectID("1");
        report.setReportAuditId("0");
        report.setReportAudit("1");
        report.setReportAuditLoginType("0");
        report.setReportSendOut("0");
        report.setPrintStatus("0");
        report.setGetReportType("自取");
        report.setUploadFlag(UploadFlagUtils.CtoGB_Num(report.getConSignID(), "z", new Date(), null));
        PrintReport printReportOld = printReportMapper.queryByConSignID(report.getConSignID());
        if (printReportOld == null) {
            printReportMapper.insertPrintReport(report);
            experimentMapper.updateByPrimaryKeySelective(new Experiment().setId(experiment.getId()).setReportNo(report.getReportID()).setReportDate(reportDate));
        } /*李总确认目前只新增，不修改
        else {
            report.setID(printReportOld.getID());
            printReportMapper.updatePrintReport(report);
        }*/
        log.info("操作协会【Print_Report】表成功，入参：【{}】", JsonUtils.getJson(report));
    }

    //判断对应实验项目是否存在平均值
    private boolean isSnTestPojector(List<ExperimentDetail> experimentDetailList) {
        int count = 0;
        for (ExperimentDetail detail : experimentDetailList) {
            JSONObject objJson = detail.getObjJson();
            //凝结时间
            if (detail.getTestProjectCode().equals(CementEnum.NJSJ.getTestProjectType())) {
                CementNjsj cementNjsj = JsonUtils.getObject(objJson, CementNjsj.class);
                CementNjsj.Jgjs jgjs = cementNjsj.getJgjs();
                if (NullUtils.isNull(jgjs.getCnsj()) || NullUtils.isNull(jgjs.getZnsj())) {
                    return false;
                } else {
                    count++;
                }
            }
            //安定性
            if (detail.getTestProjectCode().equals(CementEnum.ADX.getTestProjectType())) {
                CementAdx cementAdx = objJson.toJavaObject(CementAdx.class);
                CementAdx.Lsf lsf = cementAdx.getLsf();
                CementAdx.Sbf sbf = cementAdx.getSbf();
                if (NullUtils.isNull(sbf.getJl()) && NullUtils.isNull(lsf.getPjz())) {
                    return false;
                } else {
                    count++;
                }
            }
            //标准稠度
            if (detail.getTestProjectCode().equals(CementEnum.BZCD.getTestProjectType())) {
                CementBzcd cementBzcd = objJson.toJavaObject(CementBzcd.class);
                if (NullUtils.isNull(cementBzcd.getBzcdysl())) {
                    return false;
                } else {
                    count++;
                }
            }
            //3d抗压强度
            if (detail.getTestProjectCode().equals(CementEnum.QDCD.getTestProjectType())) {
                CementQdcd cementQdcd = JsonUtils.getObject(objJson, CementQdcd.class);
                CementQdcd.Kyqdsy kyqdsy3d = cementQdcd.getKyqdsy3d();
                if (NullUtils.isNull(kyqdsy3d.getPjz())) {
                    return false;
                } else {
                    count++;
                }
            }
        }
        if (count == 4) {
            return true;
        }
        return false;
    }

    //保存/完成台账混凝土 试验结果 同步至上海协会
    private void finishConcreteTest(String sampleNo, List<ExperimentDetail> experimentDetailList, Experiment experiment) {
        //查询品控配置
        /**获取所有混凝土 批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.CONCRETE.getCode()));

        //查询出品控的混凝土试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.CONCRETE.getTestProjectType()));
        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.CONCRETE.getTestProjectType()));

        for (ExperimentDetail detail : experimentDetailList) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //抗压强度
            if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KYQD.getCode())) {

                ConcreteKyqd concreteKyqd = objJson.toJavaObject(ConcreteKyqd.class);

                DataConcreteKy dataConcreteKy = new DataConcreteKy();

                if (concreteKyqd != null) {

                    dataConcreteKy.setS1(1);
                    dataConcreteKy.setS2(NullUtils.ifNull(concreteKyqd.getPjz28d()));
                    dataConcreteKy.setS3(NullUtils.ifNull(concreteKyqd.getFyxs28d()));

                    dataConcreteKy.setS28(NullUtils.ifNull(concreteKyqd.getZsbzqd28d()));
                    dataConcreteKy.setConclusion(NullUtils.ifNull(concreteKyqd.getFyxs28d()));

                    if (concreteKyqd.getSjcc() != null && !concreteKyqd.getSjcc().isEmpty()) {
                        String sjcc = concreteKyqd.getSjcc();
                        String val = "";
                        if (sjcc.contains("100")) {
                            val = "100";
                        } else if (sjcc.contains("150")) {
                            val = "150";
                        } else if (sjcc.contains("200")) {
                            val = "200";
                        }

                        dataConcreteKy.setS4(Integer.parseInt(val));
                        dataConcreteKy.setS5(Integer.parseInt(val));
                        dataConcreteKy.setS6(Integer.parseInt(val));
                        dataConcreteKy.setS7(Integer.parseInt(val));
                        dataConcreteKy.setS8(Integer.parseInt(val));
                        dataConcreteKy.setS9(Integer.parseInt(val));
                    }

                    if (concreteKyqd.getQd28d() != null && !concreteKyqd.getQd28d().isEmpty()) {

                        List<ConcreteKyqd.QdInfo> qd28d = concreteKyqd.getQd28d();
                        for (ConcreteKyqd.QdInfo qdInfo : qd28d) {
                            if (qdInfo.getIndex() != null && "1".equals(qdInfo.getIndex())) {
                                dataConcreteKy.setS13(NullUtils.ifNull(qdInfo.getHz()));
                                dataConcreteKy.setS16(NullUtils.ifNull(qdInfo.getQd()));
                            } else if (qdInfo.getIndex() != null && "2".equals(qdInfo.getIndex())) {
                                dataConcreteKy.setS14(NullUtils.ifNull(qdInfo.getHz()));
                                dataConcreteKy.setS17(NullUtils.ifNull(qdInfo.getQd()));
                            } else if (qdInfo.getIndex() != null && "3".equals(qdInfo.getIndex())) {
                                dataConcreteKy.setS15(NullUtils.ifNull(qdInfo.getHz()));
                                dataConcreteKy.setS18(NullUtils.ifNull(qdInfo.getQd()));
                            }
                        }
                    }

                    dataConcreteKy.setS10("符合要求");
                    dataConcreteKy.setS11("符合要求");
                    dataConcreteKy.setS12("符合要求");
                    dataConcreteKy.setS19("破损");
                    dataConcreteKy.setS20("破损");
                    dataConcreteKy.setS21("破损");


                    //判断依据
                    String judgeGist = experiment.getJudgeGist();
                    //试验依据
                    String experimentGist = experiment.getExperimentGist();
                /*    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KYQD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }*/

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataConcreteKy, "力学室", concreteKyqd.getJcrq(), detail);

                    dataConcreteKy.setSampleName("混凝土立方体试件");

                    Map<String, Object> data_jgcl_hnt_hntkyBySampleNo = concreteLaboratoryMapper.findDATA_JGCL_HNT_HNTKYBySampleNo(sampleNo);

                    if (data_jgcl_hnt_hntkyBySampleNo == null) {
                        concreteLaboratoryMapper.addDATA_JGCL_HNT_HNTKY(dataConcreteKy);
                    } else {
                        //修改
                        concreteLaboratoryMapper.updateDATA_JGCL_HNT_HNTKY(dataConcreteKy);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    //项目id 默认为0
                    String parameterID = "0";

                    String jcrq = null;

                    jcrq = concreteKyqd.getJcrq();

                    defaultUc.setConclusion(concreteKyqd.getDxjl7d());
                    defaultUc.setUcResultValue(concreteKyqd.getDxjl7d());
                    defaultUc.setUcTestValue(concreteKyqd.getPjz7d());


                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KYQD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }


                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.CONCRETE_PARAM_KYQD.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "kyqd");
                            }
                        }
                    }


                    //赋值
                    setDefUc(defaultUc, experiment, "力学室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id

                    defaultUc.setSampleName("混凝土立方体试件");

                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);


                }
                //抗渗等级
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KSDJ.getCode())) {

                ConcreteKsdj concreteKsdj = objJson.toJavaObject(ConcreteKsdj.class);
                DataConcreteKs dataConcreteKs = new DataConcreteKs();

                if (concreteKsdj != null) {

                    if (concreteKsdj.getSsksdj() != null && !concreteKsdj.getSsksdj().isEmpty()) {
                        dataConcreteKs.setConclusion("合格" + NullUtils.ifNull(concreteKsdj.getSsksdj()));
                    }

                    List<DataConcreteKsk> kskList = new ArrayList<>();

                    if (concreteKsdj.getKsInfo() != null && concreteKsdj.getKsInfo().size() != 0) {
                        List<ConcreteKsdj.KsInfo> ksInfo = concreteKsdj.getKsInfo();
                        for (ConcreteKsdj.KsInfo ks : ksInfo) {
                            DataConcreteKsk dataConcreteKsk = new DataConcreteKsk();
                            dataConcreteKsk.setSampleNo(sampleNo);
                            dataConcreteKsk.setS1(NullUtils.ifNull(ks.getSyyl()));
                            if (StringUtils.isNotBlank(ks.getJysj())) {
                                Date date = DateHelper.parseDateTime(DateHelper.getDefaultDateTimeFormat(), DateHelper.getDefaultLocal(), ks.getJysj());

                                if (date == null) {
                                    log.error("加压时间转换错误。。。" + ks.getJysj());
                                    throw new RuntimeException("加压时间转换错误。。。" + ks.getJysj());
                                }
                                dataConcreteKsk.setS2(date);
                            }
                            dataConcreteKsk.setS3(NullUtils.isSs(ks.getSfss1()));
                            dataConcreteKsk.setS5(NullUtils.isSs(ks.getSfss2()));
                            dataConcreteKsk.setS7(NullUtils.isSs(ks.getSfss3()));
                            dataConcreteKsk.setS9(NullUtils.isSs(ks.getSfss4()));
                            dataConcreteKsk.setS11(NullUtils.isSs(ks.getSfss5()));
                            dataConcreteKsk.setS13(NullUtils.isSs(ks.getSfss6()));
                            dataConcreteKsk.setS15(NullUtils.ifNull(ks.getZbr()));
                            kskList.add(dataConcreteKsk);
                        }
                    }

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KSDJ.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataConcreteKs, "力学室", concreteKsdj.getJcrq(), detail);


                    dataConcreteKs.setSampleName("混凝土抗渗试件");

                    //抗渗1
                    Map<String, Object> data_jgcl_hntks_ks_mBySampleNo = concreteLaboratoryMapper.findDATA_JGCL_HNTKS_KS_MBySampleNo(sampleNo);

                    if (data_jgcl_hntks_ks_mBySampleNo == null) {
                        concreteLaboratoryMapper.addDATA_JGCL_HNTKS_KS_M(dataConcreteKs);
                    } else {
                        concreteLaboratoryMapper.updateDATA_JGCL_HNTKS_KS_M(dataConcreteKs);
                    }
                    //抗渗2

                    List<DataConcreteKsk> data_jgcl_hntks_ks_kBySampleNo = concreteLaboratoryMapper.findDATA_JGCL_HNTKS_KS_KBySampleNo(sampleNo);

                    if (data_jgcl_hntks_ks_kBySampleNo.isEmpty() || data_jgcl_hntks_ks_kBySampleNo.size() == 0) {
                        for (DataConcreteKsk ksk : kskList) {
                            concreteLaboratoryMapper.addDATA_JGCL_HNTKS_KS_K(ksk);
                        }
                    } else {
                        //先删除 在新增所有
                        concreteLaboratoryMapper.delDATA_JGCL_HNTKS_KS_K(sampleNo);

                        for (DataConcreteKsk ksk : kskList) {
                            concreteLaboratoryMapper.addDATA_JGCL_HNTKS_KS_K(ksk);
                        }
                    }
                }
                //抗折强度
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KZQD.getCode())) {
                ConcreteKzqd concreteKzqd = objJson.toJavaObject(ConcreteKzqd.class);

                DataConcreteKz dataConcreteKz = new DataConcreteKz();
                if (concreteKzqd != null) {

                    /*if(StringUtils.isNotBlank(concreteKzqd.getSjcc())){
                        String[] split = concreteKzqd.getSjcc().split("\\*");
                        String width = split[0];
                        String height = split[1];
                        String supportDistance = split[2];

                        dataConcreteKz.setWidth1(width);
                        dataConcreteKz.setWidth2(width);
                        dataConcreteKz.setWidth3(width);

                        dataConcreteKz.setHigh1(height);
                        dataConcreteKz.setHigh2(height);
                        dataConcreteKz.setHigh3(height);

                        dataConcreteKz.setSupportDistance1(supportDistance);
                        dataConcreteKz.setSupportDistance2(supportDistance);
                        dataConcreteKz.setSupportDistance3(supportDistance);
                    }*/

                    if (StringUtils.isNotBlank(concreteKzqd.getDdsjqd())) {
                        dataConcreteKz.setConclusion(concreteKzqd.getDdsjqd() + "%");
                    }
                    dataConcreteKz.setFullyMeetTheDesignStrength(NullUtils.ifNull(concreteKzqd.getDdsjqd()));
                    dataConcreteKz.setEquivalentToTheStandardIntensity(NullUtils.ifNull(concreteKzqd.getZsbzqd()));
                    dataConcreteKz.setAverageFlexuralStrength(NullUtils.ifNull(concreteKzqd.getPjz()));
                    dataConcreteKz.setXsws(2);


                    String ypdj = experiment.getSampleLevel();
                    if (StringUtils.isNotBlank(ypdj)) {
                        String mesTpzToKz = ConvertUtils.getMesTpzToKzyq(ypdj);
                        if (org.apache.commons.lang.StringUtils.isNotBlank(mesTpzToKz)) {
                            mesTpzToKz = mesTpzToKz + "MPa";
                            dataConcreteKz.setBzz(NullUtils.ifNull(mesTpzToKz));
                        }
                    }

                    for (ConcreteKzqd.KzInfo kz : concreteKzqd.getKz28d()) {
                        if ("1".equals(kz.getIndex())) {
                            dataConcreteKz.setWidth1(NullUtils.ifNull(kz.getKz()));
                            dataConcreteKz.setHigh1(NullUtils.ifNull(kz.getGz()));
                            dataConcreteKz.setSupportDistance1(NullUtils.ifNull(kz.getZj()));
                            dataConcreteKz.setDetectionOfPre1(NullUtils.ifNull(kz.getYqqk()));
                            dataConcreteKz.setDamageToLoad1(NullUtils.ifNull(kz.getPhhz()));
                            dataConcreteKz.setFlexuralStrength1(NullUtils.ifNull(kz.getKzqd()));
                            dataConcreteKz.setFractureSurfacesPosition1(NullUtils.ifNull(kz.getZt()));
                            dataConcreteKz.setAfterDetection1(NullUtils.ifNull(kz.getYhqk()));
                        } else if ("2".equals(kz.getIndex())) {
                            dataConcreteKz.setWidth2(NullUtils.ifNull(kz.getKz()));
                            dataConcreteKz.setHigh2(NullUtils.ifNull(kz.getGz()));
                            dataConcreteKz.setSupportDistance2(NullUtils.ifNull(kz.getZj()));
                            dataConcreteKz.setDetectionOfPre2(NullUtils.ifNull(kz.getYqqk()));
                            dataConcreteKz.setDamageToLoad2(NullUtils.ifNull(kz.getPhhz()));
                            dataConcreteKz.setFlexuralStrength2(NullUtils.ifNull(kz.getKzqd()));
                            dataConcreteKz.setFractureSurfacesPosition2(NullUtils.ifNull(kz.getZt()));
                            dataConcreteKz.setAfterDetection2(NullUtils.ifNull(kz.getYhqk()));
                        } else if ("3".equals(kz.getIndex())) {
                            dataConcreteKz.setWidth3(NullUtils.ifNull(kz.getKz()));
                            dataConcreteKz.setHigh3(NullUtils.ifNull(kz.getGz()));
                            dataConcreteKz.setSupportDistance3(NullUtils.ifNull(kz.getZj()));
                            dataConcreteKz.setDetectionOfPre3(NullUtils.ifNull(kz.getYqqk()));
                            dataConcreteKz.setDamageToLoad3(NullUtils.ifNull(kz.getPhhz()));
                            dataConcreteKz.setFlexuralStrength3(NullUtils.ifNull(kz.getKzqd()));
                            dataConcreteKz.setFractureSurfacesPosition3(NullUtils.ifNull(kz.getZt()));
                            dataConcreteKz.setAfterDetection3(NullUtils.ifNull(kz.getYhqk()));
                        }
                    }


                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KZQD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataConcreteKz, "水泥检测室", concreteKzqd.getJcrq(), detail);

                    dataConcreteKz.setSampleName("混凝土抗折试件");

                    DataConcreteKz data_jgcl_hnt_kzqdBySampleNo = concreteLaboratoryMapper.findDATA_JGCL_HNT_KZQDBySampleNo(sampleNo);

                    if (data_jgcl_hnt_kzqdBySampleNo == null) {
                        concreteLaboratoryMapper.addDATA_JGCL_HNT_KZQD(dataConcreteKz);
                    } else {
                        //修改
                        concreteLaboratoryMapper.updateDATA_JGCL_HNT_KZQD(dataConcreteKz);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    //项目id 默认为0
                    String parameterID = "0";

                    String jcrq = null;

                    jcrq = concreteKzqd.getJcrq();

                /*    defaultUc.setConclusion(concreteKyqd.getDxjl7d());
                    defaultUc.setUcResultValue(concreteKyqd.getDxjl7d());
                    defaultUc.setUcTestValue(concreteKyqd.getPjz7d());*/
                    if (StringUtils.isNotBlank(concreteKzqd.getDdsjqd())) {
                        defaultUc.setConclusion(concreteKzqd.getDdsjqd() + "%");
                        defaultUc.setUcResultValue(concreteKzqd.getDdsjqd() + "%");
                    }

                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_PARAM_KZQD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }


                    //根据物料信息设置判断配置
          /*          for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.CONCRETE_PARAM_KZQD.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "kzqd");
                            }
                        }
                    }*/


                    //赋值
                    setDefUc(defaultUc, experiment, "水泥检测室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id

                    defaultUc.setSampleName("混凝土抗折试件");

                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);


                }
            }
        }
    }

    //保存/完成台账外加剂 试验结果 同步至上海协会
    private void finishAdmixtureTest(String sampleNo, List<ExperimentDetail> experimentDetailList, Experiment experiment, String samId) {
        //查询品控配置
        /**获取所有外加剂 批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.ADMIXTURE.getCode()));

        //查询出品控的外加剂试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.ADMIXTURE.getTestProjectType()));
        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.ADMIXTURE.getTestProjectType()));

        //循环试验结果数据
        for (ExperimentDetail detail : experimentDetailList) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //PH值
            if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_PHZ.getCode())) {
                ConcreteAdmixturePhz concreteAdmixturePhz = objJson.toJavaObject(ConcreteAdmixturePhz.class);

                DataWjjPhz dataWjjPhz = new DataWjjPhz();

                if (concreteAdmixturePhz != null) {
                    dataWjjPhz.setPHZ(NullUtils.ifNullDouble(concreteAdmixturePhz.getSy1ph()));
                    dataWjjPhz.setPHZ1(NullUtils.ifNullDouble(concreteAdmixturePhz.getSy2ph()));
                    dataWjjPhz.setAVGPHZ(NullUtils.ifNullDouble(concreteAdmixturePhz.getPjph()));
                    dataWjjPhz.setConclusion(NullUtils.ifNull(concreteAdmixturePhz.getDxjl()));
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_PHZ.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }
                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjPhz, "化学检测室", concreteAdmixturePhz.getJcrq(), detail);

                    //根据样品编码查询外加剂PH值
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_PHZBySampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂PH值
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_PHZ(dataWjjPhz);
                    } else {
                        //修改外加剂PH值
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_PHZ(dataWjjPhz);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = concreteAdmixturePhz.getJcrq();

                        defaultUc.setConclusion(concreteAdmixturePhz.getDxjl());
                        defaultUc.setUcResultValue(concreteAdmixturePhz.getDxjl());

                        if (StringUtils.isNotBlank(concreteAdmixturePhz.getSccjkzz1()) && StringUtils.isNotBlank(concreteAdmixturePhz.getSccjkzz2())) {
                            defaultUc.setUcStandardValue(concreteAdmixturePhz.getSccjkzz1() + "±" + concreteAdmixturePhz.getSccjkzz2());
                        }

                        defaultUc.setUcTestValue(concreteAdmixturePhz.getPjph());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_PHZ.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                      /*  for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_PHZ.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "phz");
                                }
                            }
                        }*/


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
                //密度
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_MD.getCode())) {

                ConcreteAdmixtureMd concreteAdmixtureMd = objJson.toJavaObject(ConcreteAdmixtureMd.class);

                DataWjjMd dataWjjMd = new DataWjjMd();


                if (concreteAdmixtureMd != null && concreteAdmixtureMd.getJmmdInfo() != null) {

                    ConcreteAdmixtureMd.JdmdInfo jmmdInfo = concreteAdmixtureMd.getJmmdInfo();
                    dataWjjMd.setMethod("3");//定死为3  精密密度计法
                    dataWjjMd.setALLMD(NullUtils.ifNullDouble(jmmdInfo.getMdpjz()));
                    dataWjjMd.setCMD(NullUtils.ifNullDouble(jmmdInfo.getSy1md()));
                    dataWjjMd.setCMDCOPY(NullUtils.ifNullDouble(jmmdInfo.getSy2md()));
                    dataWjjMd.setConclusion(NullUtils.ifNull(concreteAdmixtureMd.getDxjl()));

                    dataWjjMd.setALLCSKZZ(NullUtils.ifNullDouble(concreteAdmixtureMd.getSccjkzz1()));
                    dataWjjMd.setSUBMITCSKZZCOPY(NullUtils.ifNullDouble(concreteAdmixtureMd.getSccjkzz2()));
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_MD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjMd, "化学检测室", concreteAdmixtureMd.getJcrq(), detail);

                    //根据样品编码查询外加剂PH值
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_MDBySampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂PH值
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_MD(dataWjjMd);
                    } else {
                        //修改外加剂PH值
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_MD(dataWjjMd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = concreteAdmixtureMd.getJcrq();

                        defaultUc.setConclusion(concreteAdmixtureMd.getDxjl());
                        defaultUc.setUcResultValue(concreteAdmixtureMd.getDxjl());
                        defaultUc.setUcTestValue(concreteAdmixtureMd.getJmmdInfo().getMdpjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_MD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                  /*      //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_MD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "md");
                                }
                            }
                        }*/

                        if (StringUtils.isNotBlank(concreteAdmixtureMd.getSccjkzz1()) && StringUtils.isNotBlank(concreteAdmixtureMd.getSccjkzz2())) {
                            defaultUc.setUcStandardValue(concreteAdmixtureMd.getSccjkzz1() + "±" + concreteAdmixtureMd.getSccjkzz2());
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
                //含固量
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_HGL.getCode())) {
                ConcreteAdmixtureHgl concreteAdmixtureHgl = objJson.toJavaObject(ConcreteAdmixtureHgl.class);

                DataWjjHgl dataWjjHgl = new DataWjjHgl();

                if (concreteAdmixtureHgl != null) {
                    dataWjjHgl.setAVGHGL(NullUtils.ifNullBigDecimal(concreteAdmixtureHgl.getPjhgl()));
                    dataWjjHgl.setConclusion(NullUtils.ifNull(concreteAdmixtureHgl.getDxjl()));
                    dataWjjHgl.setSUBMITCSKZZ(NullUtils.ifNullBigDecimal(concreteAdmixtureHgl.getSccjkzz1()));
                    dataWjjHgl.setSubmitcskzzCopy(NullUtils.ifNullBigDecimal(concreteAdmixtureHgl.getSccjkzz2()));

                    ConcreteAdmixtureHgl.SyInfo sy1Info = concreteAdmixtureHgl.getSy1Info();
                    if (sy1Info != null) {
                        dataWjjHgl.setS1P1(NullUtils.ifNullBigDecimal(sy1Info.getClp()));
                        dataWjjHgl.setS1HGL(NullUtils.ifNullBigDecimal(sy1Info.getHgl()));
                        dataWjjHgl.setS1M1(NullUtils.ifNullBigDecimal(sy1Info.getSyzl()));
                        dataWjjHgl.setS1M2(NullUtils.ifNullBigDecimal(sy1Info.getHghzl()));
                    }

                    ConcreteAdmixtureHgl.SyInfo sy2Info = concreteAdmixtureHgl.getSy2Info();
                    if (sy1Info != null) {
                        dataWjjHgl.setS2P1(NullUtils.ifNullBigDecimal(sy2Info.getClp()));
                        dataWjjHgl.setS2HGL(NullUtils.ifNullBigDecimal(sy2Info.getHgl()));
                        dataWjjHgl.setS2M1(NullUtils.ifNullBigDecimal(sy2Info.getSyzl()));
                        dataWjjHgl.setS2M2(NullUtils.ifNullBigDecimal(sy2Info.getHghzl()));
                    }

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";

                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_HGL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();

                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjHgl, "化学检测室", concreteAdmixtureHgl.getJcrq(), detail);

                    //根据样品编码查询外加剂含固量
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_HGL_GBTBySampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂含固量
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_HGL_GBT(dataWjjHgl);
                    } else {
                        //修改外加剂含固量
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_HGL_GBT(dataWjjHgl);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = concreteAdmixtureHgl.getJcrq();

                        defaultUc.setConclusion(concreteAdmixtureHgl.getDxjl());
                        defaultUc.setUcResultValue(concreteAdmixtureHgl.getDxjl());
                        defaultUc.setUcTestValue(concreteAdmixtureHgl.getPjhgl());


                        //获取标准值
                  /*      for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_HGL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }*/

                        defaultUc.setUcUnit("%");

                        if (StringUtils.isNotBlank(concreteAdmixtureHgl.getSccjkzz1()) && StringUtils.isNotBlank(concreteAdmixtureHgl.getSccjkzz2())) {
                            double standardValue = Double.parseDouble(concreteAdmixtureHgl.getSccjkzz1()) - Double.parseDouble(concreteAdmixtureHgl.getSccjkzz2());
                            double standardValue2 = Double.parseDouble(concreteAdmixtureHgl.getSccjkzz1()) + Double.parseDouble(concreteAdmixtureHgl.getSccjkzz2());
                            defaultUc.setUcStandardValue(standardValue + "～" + standardValue2);
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_HGL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "hgl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }

                }
                //凝结时间之差
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_NJSJZC.getCode())) {
                ConcreteAdmixtureNjsjzc concreteAdmixtureNjsjzc = objJson.toJavaObject(ConcreteAdmixtureNjsjzc.class);

                DataWjjNjsj dataWjjNjsj = new DataWjjNjsj();

                if (concreteAdmixtureNjsjzc != null) {
                    dataWjjNjsj.setConclusion(NullUtils.ifNull(concreteAdmixtureNjsjzc.getCndxjl()));
                    dataWjjNjsj.setS1Result(stringToIntRounding(concreteAdmixtureNjsjzc.getSjhntcnsjpjz()));
                    dataWjjNjsj.setV1Result(stringToIntRounding(concreteAdmixtureNjsjzc.getSjhntznsjpjz()));
                    dataWjjNjsj.setS2Result(stringToIntRounding(concreteAdmixtureNjsjzc.getJzhntcnsjpjz()));
                    dataWjjNjsj.setV2Result(stringToIntRounding(concreteAdmixtureNjsjzc.getJzhntznsjpjz()));
                    dataWjjNjsj.setAvgsResult(stringToIntRounding(concreteAdmixtureNjsjzc.getCnsjzc()));
                    dataWjjNjsj.setAvgVResult(stringToIntRounding(concreteAdmixtureNjsjzc.getZnsjzc()));

                    //存储详情数据
                    List<DataWjjNjsjDetail> dataWjjNjsjDetailList = new ArrayList<>();

                    List<ConcreteAdmixtureNjsjzc.NjsjzcList> njsjzcList = concreteAdmixtureNjsjzc.getNjsjzcList();
                    int con = 1;
                    String jcsj = null;
                    for (ConcreteAdmixtureNjsjzc.NjsjzcList nj : njsjzcList) {
                        if (con == 1) {
                            jcsj = NullUtils.ifNull(nj.getJcrq());
                            dataWjjNjsj.setS1M1(stringToIntRounding(nj.getSjhntddcnsj()));
                            dataWjjNjsj.setS2M1(stringToIntRounding(nj.getJzhntddcnsj()));
                            dataWjjNjsj.setS1M1Time(NullUtils.ifNullDate(nj.getSjhntjssj()));
                            dataWjjNjsj.setS2M1Time(NullUtils.ifNullDate(nj.getJzhntjssj()));
                            dataWjjNjsj.setV1M1(stringToIntRounding(nj.getSjhntddznsj()));
                            dataWjjNjsj.setV2M1(stringToIntRounding(nj.getJzhntddznsj()));

                            int xh1 = 1;
                            //这里面是第一次试验的  所以GroupIndex 为 基准4  受检 1
                            List<ConcreteAdmixtureNjsjzc.HntInfoList> hntInfoList = nj.getHntInfoList();
                            for (ConcreteAdmixtureNjsjzc.HntInfoList hnt : hntInfoList) {
                                DataWjjNjsjDetail njsjDetail = new DataWjjNjsjDetail();
                                njsjDetail.setRecordIndex((Integer) xh1);
                                njsjDetail.setGroupIndex((Integer) 4);
                                njsjDetail.setTime(NullUtils.ifNullDate(hnt.getJzhntsj()));
                                njsjDetail.setS1(NullUtils.ifNullDouble(hnt.getJzhntgrzl()) == null ? null : NullUtils.ifNullDouble(hnt.getJzhntgrzl()) * 1000);
                                njsjDetail.setS2(NullUtils.ifNullDouble(hnt.getJzhntqd()));
                                njsjDetail.setSJMJ(NullUtils.ifNullInteger(hnt.getJzhntszmj()));

                                dataWjjNjsjDetailList.add(njsjDetail);

                                DataWjjNjsjDetail njsjDetailTwo = new DataWjjNjsjDetail();
                                njsjDetailTwo.setRecordIndex((Integer) xh1);
                                njsjDetailTwo.setGroupIndex((Integer) 1);
                                njsjDetailTwo.setTime(NullUtils.ifNullDate(hnt.getSjhntsj()));
                                njsjDetailTwo.setS1(NullUtils.ifNullDouble(hnt.getSjhntgrzl()) == null ? null : NullUtils.ifNullDouble(hnt.getSjhntgrzl()) * 1000);
                                njsjDetailTwo.setS2(NullUtils.ifNullDouble(hnt.getSjhntqd()));
                                njsjDetailTwo.setSJMJ(NullUtils.ifNullInteger(hnt.getSjhntszmj()));

                                dataWjjNjsjDetailList.add(njsjDetailTwo);

                                xh1++;
                            }


                        } else if (con == 2) {
                            jcsj = NullUtils.ifNull(nj.getJcrq());
                            dataWjjNjsj.setS1M2(stringToIntRounding(nj.getSjhntddcnsj()));
                            dataWjjNjsj.setS2M2(stringToIntRounding(nj.getJzhntddcnsj()));
                            dataWjjNjsj.setS1M2Time(NullUtils.ifNullDate(nj.getSjhntjssj()));
                            dataWjjNjsj.setS2M2Time(NullUtils.ifNullDate(nj.getJzhntjssj()));
                            dataWjjNjsj.setV1M2(stringToIntRounding(nj.getSjhntddznsj()));
                            dataWjjNjsj.setV2M2(stringToIntRounding(nj.getJzhntddznsj()));

                            int xh2 = 1;
                            //这里面是第二次试验的  所以GroupIndex 为 基准5  受检 2
                            List<ConcreteAdmixtureNjsjzc.HntInfoList> hntInfoList = nj.getHntInfoList();
                            for (ConcreteAdmixtureNjsjzc.HntInfoList hnt : hntInfoList) {
                                DataWjjNjsjDetail njsjDetail = new DataWjjNjsjDetail();
                                njsjDetail.setRecordIndex((Integer) xh2);
                                njsjDetail.setGroupIndex((Integer) 5);
                                njsjDetail.setTime(NullUtils.ifNullDate(hnt.getJzhntsj()));
                                njsjDetail.setS1(NullUtils.ifNullDouble(hnt.getJzhntgrzl()) == null ? null : NullUtils.ifNullDouble(hnt.getJzhntgrzl()) * 1000);
                                njsjDetail.setS2(NullUtils.ifNullDouble(hnt.getJzhntqd()));
                                njsjDetail.setSJMJ(NullUtils.ifNullInteger(hnt.getJzhntszmj()));

                                dataWjjNjsjDetailList.add(njsjDetail);

                                DataWjjNjsjDetail njsjDetailTwo = new DataWjjNjsjDetail();
                                njsjDetailTwo.setRecordIndex((Integer) xh2);
                                njsjDetailTwo.setGroupIndex((Integer) 2);
                                njsjDetailTwo.setTime(NullUtils.ifNullDate(hnt.getSjhntsj()));
                                njsjDetailTwo.setS1(NullUtils.ifNullDouble(hnt.getSjhntgrzl()) == null ? null : NullUtils.ifNullDouble(hnt.getSjhntgrzl()) * 1000);
                                njsjDetailTwo.setS2(NullUtils.ifNullDouble(hnt.getSjhntqd()));
                                njsjDetailTwo.setSJMJ(NullUtils.ifNullInteger(hnt.getSjhntszmj()));

                                dataWjjNjsjDetailList.add(njsjDetailTwo);

                                xh2++;
                            }

                        } else if (con == 3) {
                            jcsj = NullUtils.ifNull(nj.getJcrq());
                            dataWjjNjsj.setS1M3(stringToIntRounding(nj.getSjhntddcnsj()));
                            dataWjjNjsj.setS2M3(stringToIntRounding(nj.getJzhntddcnsj()));
                            dataWjjNjsj.setS1M3Time(NullUtils.ifNullDate(nj.getSjhntjssj()));
                            dataWjjNjsj.setS2M3Time(NullUtils.ifNullDate(nj.getJzhntjssj()));
                            dataWjjNjsj.setV1M3(stringToIntRounding(nj.getSjhntddznsj()));
                            dataWjjNjsj.setV2M3(stringToIntRounding(nj.getJzhntddznsj()));

                            int xh3 = 1;
                            //这里面是第三次试验的  所以GroupIndex 为 基准6  受检 3
                            List<ConcreteAdmixtureNjsjzc.HntInfoList> hntInfoList = nj.getHntInfoList();
                            for (ConcreteAdmixtureNjsjzc.HntInfoList hnt : hntInfoList) {
                                DataWjjNjsjDetail njsjDetail = new DataWjjNjsjDetail();
                                njsjDetail.setRecordIndex((Integer) xh3);
                                njsjDetail.setGroupIndex((Integer) 6);
                                njsjDetail.setTime(NullUtils.ifNullDate(hnt.getJzhntsj()));
                                njsjDetail.setS1(NullUtils.ifNullDouble(hnt.getJzhntgrzl()) == null ? null : NullUtils.ifNullDouble(hnt.getJzhntgrzl()) * 1000);
                                njsjDetail.setS2(NullUtils.ifNullDouble(hnt.getJzhntqd()));
                                njsjDetail.setSJMJ(NullUtils.ifNullInteger(hnt.getJzhntszmj()));

                                dataWjjNjsjDetailList.add(njsjDetail);

                                DataWjjNjsjDetail njsjDetailTwo = new DataWjjNjsjDetail();
                                njsjDetailTwo.setRecordIndex((Integer) xh3);
                                njsjDetailTwo.setGroupIndex((Integer) 3);
                                njsjDetailTwo.setTime(NullUtils.ifNullDate(hnt.getSjhntsj()));
                                njsjDetailTwo.setS1(NullUtils.ifNullDouble(hnt.getSjhntgrzl()) == null ? null : NullUtils.ifNullDouble(hnt.getSjhntgrzl()) * 1000);
                                njsjDetailTwo.setS2(NullUtils.ifNullDouble(hnt.getSjhntqd()));
                                njsjDetailTwo.setSJMJ(NullUtils.ifNullInteger(hnt.getSjhntszmj()));

                                dataWjjNjsjDetailList.add(njsjDetailTwo);

                                xh3++;
                            }
                        }
                        con++;
                    }

                    dataWjjNjsj.setS1M1OK(true);
                    dataWjjNjsj.setS1M2OK(true);
                    dataWjjNjsj.setS1M3OK(true);
                    dataWjjNjsj.setS2M1OK(true);
                    dataWjjNjsj.setS2M2OK(true);
                    dataWjjNjsj.setS2M3OK(true);

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_NJSJZC.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjNjsj, "化学检测室", jcsj, detail);

                    //根据样品编码查询外加剂凝结时间之差
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_NJSJZCSampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂凝结时间之差
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_NJSJZC(dataWjjNjsj);
                    } else {
                        //修改外加剂凝结时间之差
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_NJSJZC(dataWjjNjsj);
                    }


                    if (dataWjjNjsjDetailList != null && dataWjjNjsjDetailList.size() != 0) {
                        //删除所有明细
                        admixtureLaboratoryMapper.delDATA_JGCL_WJJII_NJSJZC_DETAIL(sampleNo);

                        //新增所有明细
                        for (DataWjjNjsjDetail det : dataWjjNjsjDetailList) {
                            det.setSampleNo(sampleNo);
                            String newId = keyPropertyMapper.getNewId();
                            det.setId(newId);
                            admixtureLaboratoryMapper.addDATA_JGCL_WJJII_NJSJZC_DETAIL(det);
                        }
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();


                        defaultUc.setConclusion(concreteAdmixtureNjsjzc.getCndxjl());
                        defaultUc.setUcResultValue(concreteAdmixtureNjsjzc.getCndxjl());
                        if (StringUtils.isNotBlank(concreteAdmixtureNjsjzc.getCnsjzc()) && StringUtils.isNotBlank(concreteAdmixtureNjsjzc.getZnsjzc())) {
                            defaultUc.setUcTestValue("初凝:" + concreteAdmixtureNjsjzc.getCnsjzc() + ",终凝" + concreteAdmixtureNjsjzc.getZnsjzc());
                        }


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_NJSJZC.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_NJSJZC.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "njsjzc");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcsj, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }

                //泌水率比
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_QSLB.getCode())) {
                ConcreteAdmixtureQslb concreteAdmixtureQslb = objJson.toJavaObject(ConcreteAdmixtureQslb.class);

                DataWjjMslb dataWjjMslb = new DataWjjMslb();

                if (concreteAdmixtureQslb != null) {
                    dataWjjMslb.setAvgMsl1(NullUtils.ifNullBigDecimal(concreteAdmixtureQslb.getSjhntpjz()));
                    dataWjjMslb.setAvgMsl2(NullUtils.ifNullBigDecimal(concreteAdmixtureQslb.getJzhntpjz()));
                    dataWjjMslb.setAvgMslB(NullUtils.ifNullBigDecimal(concreteAdmixtureQslb.getQslb()));
                    dataWjjMslb.setConclusion(NullUtils.ifNull(concreteAdmixtureQslb.getDxjl()));

                    List<ConcreteAdmixtureQslb.SjhntqslInfoList> sjhntqslInfoList = concreteAdmixtureQslb.getSjhntqslInfoList();
                    int con = 1;
                    String jcsj = null;
                    for (ConcreteAdmixtureQslb.SjhntqslInfoList sj : sjhntqslInfoList) {
                        ConcreteAdmixtureQslb.SubSjhntqslInfo sub = sj.getSubSjhntqslInfo();
                        if (sub == null) {
                            sub = new ConcreteAdmixtureQslb.SubSjhntqslInfo();
                        }
                        if (con == 1) {
                            jcsj = NullUtils.ifNull(sub.getJcrq());
                            //受检
                            dataWjjMslb.setS1VW(NullUtils.ifNullBigDecimal(sub.getSjhntqszl()));
                            dataWjjMslb.setS1W(NullUtils.ifNullBigDecimal(sub.getSjbhwysl()));
                            dataWjjMslb.setS1G(NullUtils.ifNullBigDecimal(sub.getSjbhwzzl()));
                            dataWjjMslb.setS1GW(NullUtils.ifNullBigDecimal(sub.getSjsyjz()));
                            dataWjjMslb.setS1B(NullUtils.ifNullBigDecimal(sub.getSjqsl()));
                            //基准
                            dataWjjMslb.setS4VW(NullUtils.ifNullBigDecimal(sub.getJzhntqszl()));
                            dataWjjMslb.setS4W(NullUtils.ifNullBigDecimal(sub.getJzbhwysl()));
                            dataWjjMslb.setS4G(NullUtils.ifNullBigDecimal(sub.getJzbhwzzl()));
                            dataWjjMslb.setS4GW(NullUtils.ifNullBigDecimal(sub.getJzsyjz()));
                            dataWjjMslb.setS4B(NullUtils.ifNullBigDecimal(sub.getJzqsl()));
                        } else if (con == 2) {
                            jcsj = NullUtils.ifNull(sub.getJcrq());
                            //受检
                            dataWjjMslb.setS2VW(NullUtils.ifNullBigDecimal(sub.getSjhntqszl()));
                            dataWjjMslb.setS2W(NullUtils.ifNullBigDecimal(sub.getSjbhwysl()));
                            dataWjjMslb.setS2G(NullUtils.ifNullBigDecimal(sub.getSjbhwzzl()));
                            dataWjjMslb.setS2GW(NullUtils.ifNullBigDecimal(sub.getSjsyjz()));
                            dataWjjMslb.setS2B(NullUtils.ifNullBigDecimal(sub.getSjqsl()));
                            //基准
                            dataWjjMslb.setS5VW(NullUtils.ifNullBigDecimal(sub.getJzhntqszl()));
                            dataWjjMslb.setS5W(NullUtils.ifNullBigDecimal(sub.getJzbhwysl()));
                            dataWjjMslb.setS5G(NullUtils.ifNullBigDecimal(sub.getJzbhwzzl()));
                            dataWjjMslb.setS5GW(NullUtils.ifNullBigDecimal(sub.getJzsyjz()));
                            dataWjjMslb.setS5B(NullUtils.ifNullBigDecimal(sub.getJzqsl()));
                        } else if (con == 3) {
                            jcsj = NullUtils.ifNull(sub.getJcrq());
                            //受检
                            dataWjjMslb.setS3VW(NullUtils.ifNullBigDecimal(sub.getSjhntqszl()));
                            dataWjjMslb.setS3W(NullUtils.ifNullBigDecimal(sub.getSjbhwysl()));
                            dataWjjMslb.setS3G(NullUtils.ifNullBigDecimal(sub.getSjbhwzzl()));
                            dataWjjMslb.setS3GW(NullUtils.ifNullBigDecimal(sub.getSjsyjz()));
                            dataWjjMslb.setS3B(NullUtils.ifNullBigDecimal(sub.getSjqsl()));
                            //基准
                            dataWjjMslb.setS6VW(NullUtils.ifNullBigDecimal(sub.getJzhntqszl()));
                            dataWjjMslb.setS6W(NullUtils.ifNullBigDecimal(sub.getJzbhwysl()));
                            dataWjjMslb.setS6G(NullUtils.ifNullBigDecimal(sub.getJzbhwzzl()));
                            dataWjjMslb.setS6GW(NullUtils.ifNullBigDecimal(sub.getJzsyjz()));
                            dataWjjMslb.setS6B(NullUtils.ifNullBigDecimal(sub.getJzqsl()));
                        }
                        con++;
                    }

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_QSLB.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjMslb, "化学检测室", jcsj, detail);

                    //根据样品编码查询外加剂泌水率比
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_MSLBBySampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂泌水率比
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_MSLB(dataWjjMslb);
                    } else {
                        //修改外加剂泌水率比
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_MSLB(dataWjjMslb);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();


                        defaultUc.setConclusion(concreteAdmixtureQslb.getDxjl());
                        defaultUc.setUcResultValue(concreteAdmixtureQslb.getDxjl());
                        defaultUc.setUcTestValue(concreteAdmixtureQslb.getQslb());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_QSLB.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_QSLB.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "qslb");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcsj, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
                //减水率
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_JSL.getCode())) {
                ConcreteAdmixtureJSL concreteAdmixtureJSL = objJson.toJavaObject(ConcreteAdmixtureJSL.class);

                DataWjjJsl dataWjjJsl = new DataWjjJsl();

                if (concreteAdmixtureJSL != null) {
                    dataWjjJsl.setAvgJSL(NullUtils.ifNullBigDecimal(concreteAdmixtureJSL.getPjz()));

                    List<ConcreteAdmixtureJSL.JslList> jslList = concreteAdmixtureJSL.getJslList();
                    int con = 1;
                    for (ConcreteAdmixtureJSL.JslList js : jslList) {
                        if (con == 1) {
                            dataWjjJsl.setS1M2(NullUtils.ifNullBigDecimal(js.getSjhntysl()));
                            dataWjjJsl.setS1M1(NullUtils.ifNullBigDecimal(js.getJzhntysl()));
                            dataWjjJsl.setS1JSL(NullUtils.ifNullBigDecimal(js.getJsl()));
                        } else if (con == 2) {
                            dataWjjJsl.setS2M2(NullUtils.ifNullBigDecimal(js.getSjhntysl()));
                            dataWjjJsl.setS2M1(NullUtils.ifNullBigDecimal(js.getJzhntysl()));
                            dataWjjJsl.setS2JSL(NullUtils.ifNullBigDecimal(js.getJsl()));
                        } else if (con == 3) {
                            dataWjjJsl.setS3M2(NullUtils.ifNullBigDecimal(js.getSjhntysl()));
                            dataWjjJsl.setS3M1(NullUtils.ifNullBigDecimal(js.getJzhntysl()));
                            dataWjjJsl.setS3JSL(NullUtils.ifNullBigDecimal(js.getJsl()));
                        }
                        con++;
                    }
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_JSL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }
                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjJsl, "化学检测室", concreteAdmixtureJSL.getJcrq(), detail);

                    //根据样品编码查询外加剂减水率
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_JSLySampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂减水率
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_JSL(dataWjjJsl);
                    } else {
                        //修改外加剂减水率
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_JSL(dataWjjJsl);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();


                        defaultUc.setConclusion(concreteAdmixtureJSL.getDxjl());
                        defaultUc.setUcResultValue(concreteAdmixtureJSL.getDxjl());
                        defaultUc.setUcTestValue(concreteAdmixtureJSL.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_JSL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_JSL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "jsl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, concreteAdmixtureJSL.getJcrq(), detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
                //塌落度1h经时变化量
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_TLD1HJSBHL.getCode())) {
                ConcreteAdmixtureTld1hjsbhl concreteAdmixtureTld1hjsbhl = objJson.toJavaObject(ConcreteAdmixtureTld1hjsbhl.class);

                DataWjjTld dataWjjTld = new DataWjjTld();

                if (concreteAdmixtureTld1hjsbhl != null) {

                    ConcreteAdmixtureTld1hjsbhl.SjhntObject szhntObject = concreteAdmixtureTld1hjsbhl.getSjhntObject();

                    // TODO 目前是随便给的值  待定
                    dataWjjTld.setS1M1(NullUtils.ifNullDouble(szhntObject.getTldpjz()));
                    dataWjjTld.setS1M2(NullUtils.ifNullDouble(szhntObject.getH1htldpjz()));
                    dataWjjTld.setS1TLD(NullUtils.ifNullDouble(szhntObject.getH1bhlpjz()));
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_TLD1HJSBHL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }
                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataWjjTld, "化学检测室", concreteAdmixtureTld1hjsbhl.getJcrq(), detail);

                    //根据样品编码查询外加剂塌落度1h经时变化量
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = admixtureLaboratoryMapper.findDATA_JGCL_WJJII_TLDBySampleNo(sampleNo);
                    //查询没值说明需要  新增外加剂塌落度1h经时变化量
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        admixtureLaboratoryMapper.addDATA_JGCL_WJJII_TLD(dataWjjTld);
                    } else {
                        //修改外加剂塌落度1h经时变化量
                        admixtureLaboratoryMapper.updateDATA_JGCL_WJJII_TLD(dataWjjTld);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();


                        defaultUc.setConclusion("合格");
                        defaultUc.setUcResultValue("合格");
                        if (concreteAdmixtureTld1hjsbhl.getSjhntObject() != null) {
                            defaultUc.setUcTestValue(concreteAdmixtureTld1hjsbhl.getSjhntObject().getH1bhlpjz());
                        }


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_TLD1HJSBHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CONCRETE_ADMIXTURE_PARAM_WJJ_TLD1HJSBHL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "tld");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, concreteAdmixtureTld1hjsbhl.getJcrq(), detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }

                }
            }
        }
    }

    //保存/完成台账细骨料 试验结果 同步至上海协会
    private void finishFineTest(String sampleNo, List<ExperimentDetail> experimentDetailList, Experiment experiment, String samId) {
        //查询品控配置
        /**获取所有细骨料 批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.FINE.getCode()));

        //查询出品控的粗骨料试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.FINE.getTestProjectType()));
        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.FINE.getTestProjectType()));

        /**获取表观密度存起来，紧密密度和堆积密度需要用到*/
        String bgmd = null;
        for (ExperimentDetail detail : experimentDetailList) {
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_BGMD.getCode())) {
                FineAggregateBgmd fineBgmd = detail.getObjJson().toJavaObject(FineAggregateBgmd.class);
                bgmd = NullUtils.ifNull(fineBgmd.getPjz());
            }
        }
        //循环试验结果数据
        for (ExperimentDetail detail : experimentDetailList) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //含泥量
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_HNL.getCode())) {
                //将json转成对象
                FineAggregateHnl fineNnl = objJson.toJavaObject(FineAggregateHnl.class);

                if (fineNnl != null) {
                    /**判断材料名称是天然砂还是机制砂 对应不同的表**/
                    List<String> materialsNameList = Arrays.asList("混合砂", "机制砂", "人工砂");
                    if (materialsNameList.contains(experiment.getMaterialsName())) {
                        DataFineAggregateYjlf dataFineNnl = new DataFineAggregateYjlf();
                        dataFineNnl.setS1("标准法");
                        FineAggregateHnl.SyjgInfo syjgInfo = fineNnl.getSyjgInfo();
                        if (syjgInfo == null) {
                            syjgInfo = new FineAggregateHnl.SyjgInfo();
                        }
                        dataFineNnl.setS2(NullUtils.ifNull(syjgInfo.getSyzl()));
                        dataFineNnl.setS3(NullUtils.ifNull(fineNnl.getJryjlryzl()));
                        dataFineNnl.setS4(NullUtils.ifNull(syjgInfo.getMbz()));
                        dataFineNnl.setS5(NullUtils.ifNull(syjgInfo.getJryjlrytj1()));
                        dataFineNnl.setS6(NullUtils.ifNull(syjgInfo.getJryjlrytj2()));
                        dataFineNnl.setS7(NullUtils.ifNull(syjgInfo.getJryjlrytj3()));
                        dataFineNnl.setS8(NullUtils.ifNull(syjgInfo.getJryjlrytj4()));
                        dataFineNnl.setS9(NullUtils.ifNull(syjgInfo.getJryjlrytj5()));
                        dataFineNnl.setS10(NullUtils.ifNull(syjgInfo.getJryjlrytj6()));
                        dataFineNnl.setS11(NullUtils.ifNull(syjgInfo.getJryjlrytj7()));
                        dataFineNnl.setS12(NullUtils.ifNull(syjgInfo.getJryjlrytj8()));
                        //TODO 缺少两个 溶液加入量 9 10 品控对应没有字段 协会未看到赋值
                        dataFineNnl.setS15(NullUtils.ifNull(syjgInfo.getSycxsj1()));
                        dataFineNnl.setS16(NullUtils.ifNull(syjgInfo.getSycxsj2()));
                        dataFineNnl.setS17(NullUtils.ifNull(syjgInfo.getSycxsj3()));
                        dataFineNnl.setS18(NullUtils.ifNull(syjgInfo.getSycxsj4()));
                        dataFineNnl.setS19(NullUtils.ifNull(syjgInfo.getSycxsj5()));
                        dataFineNnl.setS20(NullUtils.ifNull(syjgInfo.getSycxsj6()));
                        dataFineNnl.setS21(NullUtils.ifNull(syjgInfo.getSycxsj7()));
                        dataFineNnl.setS22(NullUtils.ifNull(syjgInfo.getSycxsj8()));
                        dataFineNnl.setS25(NullUtils.ifNull(fineNnl.getSycxsj1()));
                        dataFineNnl.setS26(NullUtils.ifNull(fineNnl.getDxjl()));

                        dataFineNnl.setS33(NullUtils.ifNull(fineNnl.getHnlpjz()));

                        List<FineAggregateHnl.HnljzsInfo> hnljzsInfo = fineNnl.getHnljzsInfo();
                        if (CollectionUtil.isNotEmpty(hnljzsInfo)) {
                            if (!hnljzsInfo.isEmpty()) {
                                FineAggregateHnl.HnljzsInfo hnljzsInfoOne = hnljzsInfo.get(0);
                                dataFineNnl.setS27(NullUtils.ifNull(hnljzsInfoOne.getHqsyzl()));
                                dataFineNnl.setS28(NullUtils.ifNull(hnljzsInfoOne.getHhsyzl()));
                                dataFineNnl.setS29(NullUtils.ifNull(hnljzsInfoOne.getSfhl()));
                            }
                            if (hnljzsInfo.size() > 1) {
                                FineAggregateHnl.HnljzsInfo hnljzsInfoTwo = hnljzsInfo.get(1);
                                dataFineNnl.setS30(NullUtils.ifNull(hnljzsInfoTwo.getHqsyzl()));
                                dataFineNnl.setS31(NullUtils.ifNull(hnljzsInfoTwo.getHhsyzl()));
                                dataFineNnl.setS32(NullUtils.ifNull(hnljzsInfoTwo.getHnl()));
                            }
                        }

                        //判断依据
                        String judgeGist = "";
                        //试验依据
                        String experimentGist = "";
                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                            }
                        }

                        //设置公共属性
                        setCommonProperties(sampleNo, experiment, dataFineNnl, "骨料检测室", fineNnl.getJcrq(), detail);

                        //根据样品编码查询细骨料含泥量
                        Map<String, Object> data_jgcl_ss_rgsjhhszsfhl_yjlfBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_RGSJHHSZSFHL_YJLFBySampleNo(sampleNo);
                        //查询没值说明需要  新增细骨料含泥量
                        if (data_jgcl_ss_rgsjhhszsfhl_yjlfBySampleNo == null) {
                            fineLaboratoryMapper.addDDATA_JGCL_SS_RGSJHHSZSFHL_YJLF(dataFineNnl);
                        } else {
                            //修改细骨料含泥量
                            fineLaboratoryMapper.updateDATA_JGCL_SS_RGSJHHSZSFHL_YJLF(dataFineNnl);
                        }
                    } else {
                        DataFineAggregateHnl dataFineNnl = new DataFineAggregateHnl();
                        dataFineNnl.setS7(NullUtils.ifNull(fineNnl.getHnlpjz()));

                        List<FineAggregateHnl.HnljzsInfo> hnljzsInfo = fineNnl.getHnljzsInfo();
                        if (CollectionUtil.isNotEmpty(hnljzsInfo)) {
                            if (!hnljzsInfo.isEmpty()) {
                                FineAggregateHnl.HnljzsInfo hnljzsInfoOne = hnljzsInfo.get(0);
                                dataFineNnl.setS1(NullUtils.ifNull(hnljzsInfoOne.getHqsyzl()));
                                dataFineNnl.setS2(NullUtils.ifNull(hnljzsInfoOne.getHhsyzl()));
                                dataFineNnl.setS3(NullUtils.ifNull(hnljzsInfoOne.getHnl()));
                            }
                            if (hnljzsInfo.size() > 1) {
                                FineAggregateHnl.HnljzsInfo hnljzsInfoTwo = hnljzsInfo.get(1);
                                dataFineNnl.setS4(NullUtils.ifNull(hnljzsInfoTwo.getHqsyzl()));
                                dataFineNnl.setS5(NullUtils.ifNull(hnljzsInfoTwo.getHhsyzl()));
                                dataFineNnl.setS6(NullUtils.ifNull(hnljzsInfoTwo.getHnl()));
                            }
                        }

                        //判断依据
                        String judgeGist = "";
                        //试验依据
                        String experimentGist = "";
                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                            }
                        }

                        //设置公共属性
                        setCommonProperties(sampleNo, experiment, dataFineNnl, "骨料检测室", fineNnl.getJcrq(), detail);

                        //根据样品编码查询细骨料含泥量
                        Map<String, Object> data_jgcl_ss_szhnlBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_SZHNLBySampleNo(sampleNo);
                        //查询没值说明需要  新增细骨料含泥量
                        if (data_jgcl_ss_szhnlBySampleNo == null) {
                            fineLaboratoryMapper.addDATA_JGCL_SS_SZHNL(dataFineNnl);
                        } else {
                            //修改细骨料含泥量
                            fineLaboratoryMapper.updateDATA_JGCL_SS_SZHNL(dataFineNnl);
                        }
                    }

                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineNnl.getJcrq();

                        defaultUc.setConclusion(fineNnl.getDxjl());
                        defaultUc.setUcResultValue(fineNnl.getDxjl());
                        defaultUc.setUcTestValue(fineNnl.getHnlpjz());

                        //判断依据
                        String judgeGist = "";
                        //试验依据
                        String experimentGist = "";

                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "nkhl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //压碎指标值
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_YSZZB.getCode())) {
                //将json转成对象
                FineAggregateYszzb fineYszzb = objJson.toJavaObject(FineAggregateYszzb.class);
                DataFineAggregateYszzb dataFineYszzb = new DataFineAggregateYszzb();

                if (fineYszzb != null) {
                    List<FineAggregateYszzb.YszzbList> yszzbList = fineYszzb.getYszzbList();
                    if (CollectionUtil.isNotEmpty(yszzbList)) {

                        for (FineAggregateYszzb.YszzbList yszz : yszzbList) {
                            if ("第一次实验".equals(yszz.getTypeName())) {
                                List<FineAggregateYszzb.Datum> data = yszz.getData();
                                for (FineAggregateYszzb.Datum datum : data) {
                                    if ("5.00mm~2.50mm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS1(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS2(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS3(NullUtils.ifNull(datum.getJg()));
                                    } else if ("2.50mm~1.25mm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS10(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS11(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS12(NullUtils.ifNull(datum.getJg()));
                                    } else if ("1.25mm~630μm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS19(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS20(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS21(NullUtils.ifNull(datum.getJg()));
                                    } else if ("630μm~315μm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS28(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS29(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS30(NullUtils.ifNull(datum.getJg()));
                                    }
                                }
                            } else if ("第二次实验".equals(yszz.getTypeName())) {
                                List<FineAggregateYszzb.Datum> data = yszz.getData();
                                for (FineAggregateYszzb.Datum datum : data) {
                                    if ("5.00mm~2.50mm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS4(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS5(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS6(NullUtils.ifNull(datum.getJg()));
                                    } else if ("2.50mm~1.25mm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS13(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS14(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS15(NullUtils.ifNull(datum.getJg()));
                                    } else if ("1.25mm~630μm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS22(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS23(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS24(NullUtils.ifNull(datum.getJg()));
                                    } else if ("630μm~315μm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS31(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS32(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS33(NullUtils.ifNull(datum.getJg()));
                                    }
                                }
                            } else if ("第三次实验".equals(yszz.getTypeName())) {
                                List<FineAggregateYszzb.Datum> data = yszz.getData();
                                for (FineAggregateYszzb.Datum datum : data) {
                                    if ("5.00mm~2.50mm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS7(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS8(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS9(NullUtils.ifNull(datum.getJg()));
                                    } else if ("2.50mm~1.25mm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS16(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS17(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS18(NullUtils.ifNull(datum.getJg()));
                                    } else if ("1.25mm~630μm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS25(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS26(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS27(NullUtils.ifNull(datum.getJg()));
                                    } else if ("630μm~315μm".equals(datum.getTarget())) {
                                        dataFineYszzb.setS34(NullUtils.ifNull(datum.getSyzl()));
                                        dataFineYszzb.setS35(NullUtils.ifNull(datum.getSyl()));
                                        dataFineYszzb.setS36(NullUtils.ifNull(datum.getJg()));
                                    }
                                }
                            }
                        }

                    }

                    dataFineYszzb.setS37(NullUtils.ifNull(fineYszzb.getPjz0()));
                    dataFineYszzb.setS38(NullUtils.ifNull(fineYszzb.getPjz1()));
                    dataFineYszzb.setS39(NullUtils.ifNull(fineYszzb.getPjz2()));
                    dataFineYszzb.setS40(NullUtils.ifNull(fineYszzb.getPjz3()));
                    dataFineYszzb.setS41(NullUtils.ifNull(fineYszzb.getZyszb()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_YSZZB.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFineYszzb, "骨料检测室", fineYszzb.getJcrq(), detail);

                    //根据样品编码查询细骨料压碎指标值
                    Map<String, Object> data_jgcl_ss_rgsyszzbBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_RGSYSZZBBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料压碎指标值
                    if (data_jgcl_ss_rgsyszzbBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_RGSYSZZB(dataFineYszzb);
                    } else {
                        //修改细骨料压碎指标值
                        fineLaboratoryMapper.updateDATA_JGCL_SS_RGSYSZZB(dataFineYszzb);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineYszzb.getJcrq();

                        defaultUc.setConclusion(fineYszzb.getDxjl());
                        defaultUc.setUcResultValue(fineYszzb.getDxjl());
                        defaultUc.setUcTestValue(fineYszzb.getZyszb());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_YSZZB.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_YSZZB.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "yszzb");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //表观密度
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_BGMD.getCode())) {
                //将json转成对象
                FineAggregateBgmd fineBgmd = objJson.toJavaObject(FineAggregateBgmd.class);
                DataFineAggregateBgmd dataFineBgmd = new DataFineAggregateBgmd();

                if (fineBgmd != null) {
                    List<FineAggregateBgmd.BgmdInfo> bgmdInfo = fineBgmd.getBgmdInfo();
                    if (CollectionUtil.isNotEmpty(bgmdInfo)) {
                        if (!bgmdInfo.isEmpty()) {
                            FineAggregateBgmd.BgmdInfo bgmdInfoOne = bgmdInfo.get(0);
                            if (bgmdInfoOne != null) {
                                dataFineBgmd.setS1(NullUtils.ifNull(bgmdInfoOne.getHgsyzl()));
                                dataFineBgmd.setS2(NullUtils.ifNull(bgmdInfoOne.getZzlssydl()));
                                dataFineBgmd.setS3(NullUtils.ifNull(bgmdInfoOne.getZzlsdl()));
                                dataFineBgmd.setS4(NullUtils.ifNull(fineBgmd.getSw()));
                                dataFineBgmd.setS6(NullUtils.ifNull(bgmdInfoOne.getJg()));
                            }
                        }
                        if (bgmdInfo.size() > 1) {
                            FineAggregateBgmd.BgmdInfo bgmdInfoTwo = bgmdInfo.get(1);
                            if (bgmdInfoTwo != null) {
                                dataFineBgmd.setS7(NullUtils.ifNull(bgmdInfoTwo.getHgsyzl()));
                                dataFineBgmd.setS8(NullUtils.ifNull(bgmdInfoTwo.getZzlssydl()));
                                dataFineBgmd.setS9(NullUtils.ifNull(bgmdInfoTwo.getZzlsdl()));
                                dataFineBgmd.setS12(NullUtils.ifNull(bgmdInfoTwo.getJg()));
                            }
                        }
                    }
                    dataFineBgmd.setS5(NullUtils.ifNull(fineBgmd.getXzxs()));
                    dataFineBgmd.setS13(NullUtils.ifNull(fineBgmd.getPjz()));


                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_BGMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFineBgmd, "骨料检测室", fineBgmd.getJcrq(), detail);

                    //根据样品编码查询细骨料表观密度
                    Map<String, Object> data_jgcl_ss_sdbgmd_bzfBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_SDBGMD_BZFBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料表观密度
                    if (data_jgcl_ss_sdbgmd_bzfBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_SDBGMD_BZF(dataFineBgmd);
                    } else {
                        //修改细骨料表观密度
                        fineLaboratoryMapper.updateDATA_JGCL_SS_SDBGMD_BZF(dataFineBgmd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineBgmd.getJcrq();

                        defaultUc.setConclusion(fineBgmd.getDxjl());
                        defaultUc.setUcResultValue(fineBgmd.getDxjl());
                        defaultUc.setUcTestValue(fineBgmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_BGMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_BGMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "bgmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //堆积密度
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_DJMD.getCode())) {
                //将json转成对象
                FineAggregateDjmd fineDjmd = objJson.toJavaObject(FineAggregateDjmd.class);
                DataFineAggregateDjmd dataFineDjmd = new DataFineAggregateDjmd();

                if (fineDjmd != null) {
                    List<FineAggregateDjmd.DjmdInfo> djmdbInfo = fineDjmd.getDjmdInfo();
                    if (CollectionUtil.isNotEmpty(djmdbInfo)) {
                        if (!djmdbInfo.isEmpty()) {
                            FineAggregateDjmd.DjmdInfo djmdbInfoOne = djmdbInfo.get(0);
                            if (djmdbInfoOne != null) {
                                dataFineDjmd.setS1(stringToDoubleAndDivide(fineDjmd.getRltzl()));
                                dataFineDjmd.setS2(stringToDoubleAndDivide(djmdbInfoOne.getZzl()));
                                dataFineDjmd.setS3(NullUtils.ifNullFoSum(fineDjmd.getRlttj()));
                                dataFineDjmd.setS4(NullUtils.ifNull(djmdbInfoOne.getJg()));
                            }
                        }
                        if (djmdbInfo.size() > 1) {
                            FineAggregateDjmd.DjmdInfo djmdbInfoTwo = djmdbInfo.get(1);
                            if (djmdbInfoTwo != null) {
                                dataFineDjmd.setS5(stringToDoubleAndDivide(fineDjmd.getRltzl()));
                                dataFineDjmd.setS6(stringToDoubleAndDivide(djmdbInfoTwo.getZzl()));
                                dataFineDjmd.setS7(NullUtils.ifNullFoSum(fineDjmd.getRlttj()));
                                dataFineDjmd.setS8(NullUtils.ifNull(djmdbInfoTwo.getJg()));
                            }
                        }
                    }
                    dataFineDjmd.setS9(NullUtils.ifNull(fineDjmd.getPjz()));
                    dataFineDjmd.setS10(NullUtils.ifNull(bgmd));
                    dataFineDjmd.setS11(NullUtils.ifNull(fineDjmd.getKxl()));
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_DJMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFineDjmd, "骨料检测室", fineDjmd.getJcrq(), detail);

                    //根据样品编码查询细骨料堆积密度
                    Map<String, Object> data_jgcl_ss_sddjmdBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_SDDJMDBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料堆积密度
                    if (data_jgcl_ss_sddjmdBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_SDDJMD(dataFineDjmd);
                    } else {
                        //修改细骨料堆积密度
                        fineLaboratoryMapper.updateDATA_JGCL_SS_SDDJMD(dataFineDjmd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineDjmd.getJcrq();

                        defaultUc.setConclusion(fineDjmd.getDxjl());
                        defaultUc.setUcResultValue(fineDjmd.getDxjl());
                        defaultUc.setUcTestValue(fineDjmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_DJMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_DJMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "djmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //紧密密度
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_JMMD.getCode())) {
                //将json转成对象
                FineAggregateJmmd fineJmmd = objJson.toJavaObject(FineAggregateJmmd.class);
                DataFineAggregateJmmd dataFineJmmd = new DataFineAggregateJmmd();

                if (fineJmmd != null) {
                    List<FineAggregateJmmd.JmmdInfo> jmmdInfo = fineJmmd.getJmmdInfo();
                    if (CollectionUtil.isNotEmpty(jmmdInfo)) {
                        if (!jmmdInfo.isEmpty()) {
                            FineAggregateJmmd.JmmdInfo jmmdInfoOne = jmmdInfo.get(0);
                            if (jmmdInfoOne != null) {
                                dataFineJmmd.setS1(stringToDoubleAndDivide(fineJmmd.getRltzl()));
                                dataFineJmmd.setS2(stringToDoubleAndDivide(jmmdInfoOne.getZzl()));
                                dataFineJmmd.setS3(NullUtils.ifNullFoSum(fineJmmd.getRlttj()));
                                dataFineJmmd.setS4(NullUtils.ifNull(jmmdInfoOne.getJg()));
                            }
                        }
                        if (jmmdInfo.size() > 1) {
                            FineAggregateJmmd.JmmdInfo jmmdInfoTwo = jmmdInfo.get(1);
                            if (jmmdInfoTwo != null) {
                                dataFineJmmd.setS5(stringToDoubleAndDivide(fineJmmd.getRltzl()));
                                dataFineJmmd.setS6(stringToDoubleAndDivide(jmmdInfoTwo.getZzl()));
                                dataFineJmmd.setS7(NullUtils.ifNullFoSum(fineJmmd.getRlttj()));
                                dataFineJmmd.setS8(NullUtils.ifNull(jmmdInfoTwo.getJg()));
                            }
                        }
                    }
                    dataFineJmmd.setS9(NullUtils.ifNull(fineJmmd.getPjz()));
                    dataFineJmmd.setS10(NullUtils.ifNull(bgmd));
                    dataFineJmmd.setS11(NullUtils.ifNull(fineJmmd.getKxl()));
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_JMMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFineJmmd, "骨料检测室", fineJmmd.getJcrq(), detail);

                    //根据样品编码查询细骨料紧密密度
                    Map<String, Object> data_jgcl_ss_sdjmmdBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_SDJMMDBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料紧密密度
                    if (data_jgcl_ss_sdjmmdBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_SDJMMD(dataFineJmmd);
                    } else {
                        //修改细骨料紧密密度
                        fineLaboratoryMapper.updateDATA_JGCL_SS_SDJMMD(dataFineJmmd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineJmmd.getJcrq();

                        defaultUc.setConclusion(fineJmmd.getDxjl());
                        defaultUc.setUcResultValue(fineJmmd.getDxjl());
                        defaultUc.setUcTestValue(fineJmmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_JMMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_JMMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "jmmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //筛分析
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_SFX.getCode())) {
                //将json转成对象
                FineAggregateSfx fineSfx = objJson.toJavaObject(FineAggregateSfx.class);
                DataFineAggregateKljp dataFineKljp = new DataFineAggregateKljp();

                if (fineSfx != null) {
                    dataFineKljp.setS1(NullUtils.ifNull(fineSfx.getHgsfhsyzl()));
                    dataFineKljp.setS2(NullUtils.ifNull(fineSfx.getYsklzl10()));
                    dataFineKljp.setS3(NullUtils.ifNull(fineSfx.getYsklhl10()));
                    dataFineKljp.setS4(NullUtils.ifNull(fineSfx.getDyfsyzl()));
                    dataFineKljp.setS27(NullUtils.ifNull(fineSfx.getDefsyzl()));
                    List<FineAggregateSfx.SfxInfo> sfxInfo = fineSfx.getSfxInfo();
                    if (CollectionUtil.isNotEmpty(sfxInfo)) {
                        if (!sfxInfo.isEmpty()) {
                            FineAggregateSfx.SfxInfo sfxInfoOne = sfxInfo.get(0);
                            if (sfxInfoOne != null) {
                                dataFineKljp.setS5(NullUtils.ifNull(sfxInfoOne.getSyl1()));
                                dataFineKljp.setS6(NullUtils.ifNull(sfxInfoOne.getFjsy1()));
                                dataFineKljp.setS7(NullUtils.ifNull(sfxInfoOne.getLjsy1()));

                                dataFineKljp.setS28(NullUtils.ifNull(sfxInfoOne.getSyl2()));
                                dataFineKljp.setS29(NullUtils.ifNull(sfxInfoOne.getFjsy2()));
                                dataFineKljp.setS30(NullUtils.ifNull(sfxInfoOne.getLjsy2()));

                                dataFineKljp.setS51(NullUtils.ifNull(sfxInfoOne.getLjsyppjz()));
                            }
                        }

                        if (sfxInfo.size() > 1) {
                            FineAggregateSfx.SfxInfo sfxInfoTwo = sfxInfo.get(1);
                            if (sfxInfoTwo != null) {
                                dataFineKljp.setS8(NullUtils.ifNull(sfxInfoTwo.getSyl1()));
                                dataFineKljp.setS9(NullUtils.ifNull(sfxInfoTwo.getFjsy1()));
                                dataFineKljp.setS10(NullUtils.ifNull(sfxInfoTwo.getLjsy1()));

                                dataFineKljp.setS31(NullUtils.ifNull(sfxInfoTwo.getSyl2()));
                                dataFineKljp.setS32(NullUtils.ifNull(sfxInfoTwo.getFjsy2()));
                                dataFineKljp.setS33(NullUtils.ifNull(sfxInfoTwo.getLjsy2()));

                                dataFineKljp.setS52(NullUtils.ifNull(sfxInfoTwo.getLjsyppjz()));
                            }
                        }

                        if (sfxInfo.size() > 2) {
                            FineAggregateSfx.SfxInfo sfxInfoThree = sfxInfo.get(2);
                            if (sfxInfoThree != null) {
                                dataFineKljp.setS11(NullUtils.ifNull(sfxInfoThree.getSyl1()));
                                dataFineKljp.setS12(NullUtils.ifNull(sfxInfoThree.getFjsy1()));
                                dataFineKljp.setS13(NullUtils.ifNull(sfxInfoThree.getLjsy1()));

                                dataFineKljp.setS34(NullUtils.ifNull(sfxInfoThree.getSyl2()));
                                dataFineKljp.setS35(NullUtils.ifNull(sfxInfoThree.getFjsy2()));
                                dataFineKljp.setS36(NullUtils.ifNull(sfxInfoThree.getLjsy2()));

                                dataFineKljp.setS53(NullUtils.ifNull(sfxInfoThree.getLjsyppjz()));
                            }
                        }

                        if (sfxInfo.size() > 3) {
                            FineAggregateSfx.SfxInfo sfxInfoFour = sfxInfo.get(3);
                            if (sfxInfoFour != null) {
                                dataFineKljp.setS14(NullUtils.ifNull(sfxInfoFour.getSyl1()));
                                dataFineKljp.setS15(NullUtils.ifNull(sfxInfoFour.getFjsy1()));
                                dataFineKljp.setS16(NullUtils.ifNull(sfxInfoFour.getLjsy1()));

                                dataFineKljp.setS37(NullUtils.ifNull(sfxInfoFour.getSyl2()));
                                dataFineKljp.setS38(NullUtils.ifNull(sfxInfoFour.getFjsy2()));
                                dataFineKljp.setS39(NullUtils.ifNull(sfxInfoFour.getLjsy2()));

                                dataFineKljp.setS54(NullUtils.ifNull(sfxInfoFour.getLjsyppjz()));
                            }
                        }

                        if (sfxInfo.size() > 4) {
                            FineAggregateSfx.SfxInfo sfxInfoFive = sfxInfo.get(4);
                            if (sfxInfoFive != null) {
                                dataFineKljp.setS17(NullUtils.ifNull(sfxInfoFive.getSyl1()));
                                dataFineKljp.setS18(NullUtils.ifNull(sfxInfoFive.getFjsy1()));
                                dataFineKljp.setS19(NullUtils.ifNull(sfxInfoFive.getLjsy1()));

                                dataFineKljp.setS40(NullUtils.ifNull(sfxInfoFive.getSyl2()));
                                dataFineKljp.setS41(NullUtils.ifNull(sfxInfoFive.getFjsy2()));
                                dataFineKljp.setS42(NullUtils.ifNull(sfxInfoFive.getLjsy2()));

                                dataFineKljp.setS55(NullUtils.ifNull(sfxInfoFive.getLjsyppjz()));
                            }
                        }

                        if (sfxInfo.size() > 5) {
                            FineAggregateSfx.SfxInfo sfxInfoSix = sfxInfo.get(5);
                            if (sfxInfoSix != null) {
                                dataFineKljp.setS20(NullUtils.ifNull(sfxInfoSix.getSyl1()));
                                dataFineKljp.setS21(NullUtils.ifNull(sfxInfoSix.getFjsy1()));
                                dataFineKljp.setS22(NullUtils.ifNull(sfxInfoSix.getLjsy1()));

                                dataFineKljp.setS43(NullUtils.ifNull(sfxInfoSix.getSyl2()));
                                dataFineKljp.setS44(NullUtils.ifNull(sfxInfoSix.getFjsy2()));
                                dataFineKljp.setS45(NullUtils.ifNull(sfxInfoSix.getLjsy2()));

                                dataFineKljp.setS56(NullUtils.ifNull(sfxInfoSix.getLjsyppjz()));
                            }
                        }

                        if (sfxInfo.size() > 6) {
                            FineAggregateSfx.SfxInfo sfxInfoSeven = sfxInfo.get(6);
                            if (sfxInfoSeven != null) {
                                dataFineKljp.setS23(NullUtils.ifNull(sfxInfoSeven.getSyl1()));
                                dataFineKljp.setS24(NullUtils.ifNull(sfxInfoSeven.getFjsy1()));
                                dataFineKljp.setS25(NullUtils.ifNull(sfxInfoSeven.getLjsy1()));

                                dataFineKljp.setS46(NullUtils.ifNull(sfxInfoSeven.getSyl2()));
                                dataFineKljp.setS47(NullUtils.ifNull(sfxInfoSeven.getFjsy2()));
                                dataFineKljp.setS48(NullUtils.ifNull(sfxInfoSeven.getLjsy2()));

                                dataFineKljp.setS57(NullUtils.ifNull(sfxInfoSeven.getLjsyppjz()));
                            }
                        }
                    }
                    dataFineKljp.setS26(NullUtils.ifNull(fineSfx.getXdms1()));
                    dataFineKljp.setS49(NullUtils.ifNull(fineSfx.getXdms2()));
                    dataFineKljp.setS50(NullUtils.ifNull(fineSfx.getXdmspjz()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_SFX.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    dataFineKljp.setConclusion(fineSfx.getDxjl());
                    dataFineKljp.setJPQ(fineSfx.getDxjl());
                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFineKljp, "骨料检测室", fineSfx.getJcrq(), detail);

                    //根据样品编码查询细骨料筛分析
                    Map<String, Object> data_jgcl_ss_sdsfxBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_SDSFXBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料筛分析
                    if (data_jgcl_ss_sdsfxBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_SDSFX(dataFineKljp);
                    } else {
                        //修改细骨料筛分析
                        fineLaboratoryMapper.updateDATA_JGCL_SS_SDSFX(dataFineKljp);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineSfx.getJcrq();

                        defaultUc.setConclusion(fineSfx.getDxjl());
                        defaultUc.setUcResultValue(fineSfx.getDxjl());
                        defaultUc.setUcTestValue(fineSfx.getXdmspjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_SFX.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_SFX.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "sfx");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //泥块含量
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode())) {
                //将json转成对象
                FineAggregateNkhl fineNkhl = objJson.toJavaObject(FineAggregateNkhl.class);
                DataFineAggregateNkhl dataFineNkhl = new DataFineAggregateNkhl();

                if (fineNkhl != null) {
                    List<FineAggregateNkhl.HnkInfo> hnkInfo = fineNkhl.getHnkInfo();
                    if (CollectionUtil.isNotEmpty(hnkInfo)) {
                        if (!hnkInfo.isEmpty()) {
                            FineAggregateNkhl.HnkInfo hnkInfoOne = hnkInfo.get(0);
                            if (hnkInfoOne != null) {
                                dataFineNkhl.setS1(NullUtils.ifNull(hnkInfoOne.getHqsyzl()));
                                dataFineNkhl.setS2(NullUtils.ifNull(hnkInfoOne.getHhsyzl()));
                                dataFineNkhl.setS3(NullUtils.ifNull(hnkInfoOne.getHnl()));
                            }
                        }
                        if (hnkInfo.size() > 1) {
                            FineAggregateNkhl.HnkInfo hnkInfoTwo = hnkInfo.get(1);
                            if (hnkInfoTwo != null) {
                                dataFineNkhl.setS4(NullUtils.ifNull(hnkInfoTwo.getHqsyzl()));
                                dataFineNkhl.setS5(NullUtils.ifNull(hnkInfoTwo.getHhsyzl()));
                                dataFineNkhl.setS6(NullUtils.ifNull(hnkInfoTwo.getHnl()));
                            }
                        }
                    }
                    dataFineNkhl.setS7(NullUtils.ifNull(fineNkhl.getPjz()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFineNkhl, "骨料检测室", fineNkhl.getJcrq(), detail);

                    //根据样品编码查询细骨料泥块含量
                    Map<String, Object> data_jgcl_ss_sznkhlbBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_SZNKHLBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料泥块含量
                    if (data_jgcl_ss_sznkhlbBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_SZNKHL(dataFineNkhl);
                    } else {
                        //修改细骨料泥块含量
                        fineLaboratoryMapper.updateDATA_JGCL_SS_SZNKHL(dataFineNkhl);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = fineNkhl.getJcrq();

                        defaultUc.setConclusion(fineNkhl.getDxjl());
                        defaultUc.setUcResultValue(fineNkhl.getDxjl());
                        defaultUc.setUcTestValue(fineNkhl.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_NKHL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "nkhl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
            //氯离子含量
            if (detail.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_LLZHL.getCode())) {
                //将json转成对象
                FineAggregateLlzhl llzhl = objJson.toJavaObject(FineAggregateLlzhl.class);

                DataFineAggregateLlzhl aggregateLlzhl = new DataFineAggregateLlzhl();

                if (llzhl != null) {


                    List<FineAggregateLlzhl.LlzhlInfo> llzhlInfo = llzhl.getLlzhlInfo();

                    for (FineAggregateLlzhl.LlzhlInfo ll : llzhlInfo) {
                        aggregateLlzhl.setM1(NullUtils.ifNull(ll.getYptj()));
                        aggregateLlzhl.setM2(NullUtils.ifNull(ll.getKbtj()));
                        aggregateLlzhl.setM3(NullUtils.ifNull(ll.getYpzl()));
                        aggregateLlzhl.setM4(NullUtils.ifNull(ll.getLlzhl()));
                        aggregateLlzhl.setM0(NullUtils.ifNull(ll.getXsynd()));
                        break;
                    }


                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_LLZHL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, aggregateLlzhl, "骨料检测室", llzhl.getJcrq(), detail);

                    //根据样品编码查询细骨料泥块含量
                    Map<String, Object> data_jgcl_ss_llzhlBySampleNo = fineLaboratoryMapper.findDATA_JGCL_SS_LLZHLBySampleNo(sampleNo);
                    //查询没值说明需要  新增细骨料泥块含量
                    if (data_jgcl_ss_llzhlBySampleNo == null) {
                        fineLaboratoryMapper.addDATA_JGCL_SS_LLZHL(aggregateLlzhl);
                    } else {
                        //修改细骨料泥块含量
                        fineLaboratoryMapper.updateDATA_JGCL_SS_LLZHL(aggregateLlzhl);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = llzhl.getJcrq();

                        defaultUc.setConclusion(llzhl.getDxjl());
                        defaultUc.setUcResultValue(llzhl.getDxjl());
                        defaultUc.setUcTestValue(llzhl.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_LLZHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FINE_AGGREGATE_PARAM_XGL_LLZHL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "llzhl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
        }
    }

    //保存/完成台账粗骨料 试验结果 同步至上海协会
    private void finishCoarseTest(String sampleNo, List<ExperimentDetail> experimentDetailList, Experiment experiment, String samId) {
        //查询品控配置
        /**获取所有粗骨料 批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.COARSE.getCode()));

        //查询出品控的粗骨料试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.COARSE.getTestProjectType()));
        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.COARSE.getTestProjectType()));


        /**获取表观密度存起来，紧密密度和堆积密度需要用到*/
        String bgmd = null;
        for (ExperimentDetail detail : experimentDetailList) {
            if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_BGMD.getCode())) {
                CoarseAggregateBgmd coarseBgmd = detail.getObjJson().toJavaObject(CoarseAggregateBgmd.class);
                bgmd = NullUtils.ifNull(coarseBgmd.getPjz());
            }
        }

        //循环试验结果数据
        for (ExperimentDetail detail : experimentDetailList) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //
            if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNL.getCode())) {
                //将json转成对象
                CoarseAggregateHnl coarseHnl = objJson.toJavaObject(CoarseAggregateHnl.class);
                DataCoarseAggregateHnl dataCoarseHnl = new DataCoarseAggregateHnl();

                if (coarseHnl != null) {
                    List<CoarseAggregateHnl.HnlInfo> hnlInfo = coarseHnl.getHnlInfo();
                    if (CollectionUtil.isNotEmpty(hnlInfo)) {
                        if (!hnlInfo.isEmpty()) {
                            CoarseAggregateHnl.HnlInfo hnlInfoOne = hnlInfo.get(0);
                            dataCoarseHnl.setS1(NullUtils.ifNull(hnlInfoOne.getHqsyzl()));
                            dataCoarseHnl.setS2(NullUtils.ifNull(hnlInfoOne.getHhsyzl()));
                            dataCoarseHnl.setS3(NullUtils.ifNull(hnlInfoOne.getHnl()));
                        }
                        if (hnlInfo.size() > 1) {
                            CoarseAggregateHnl.HnlInfo hnlInfoTwo = hnlInfo.get(1);
                            dataCoarseHnl.setS4(NullUtils.ifNull(hnlInfoTwo.getHqsyzl()));
                            dataCoarseHnl.setS5(NullUtils.ifNull(hnlInfoTwo.getHhsyzl()));
                            dataCoarseHnl.setS6(NullUtils.ifNull(hnlInfoTwo.getHnl()));
                        }
                    }
                    dataCoarseHnl.setS7(NullUtils.ifNull(coarseHnl.getHnlpjz()));


                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseHnl, "骨料检测室", coarseHnl.getJcrq(), detail);


                    //根据样品编码查询粗骨料含泥量
                    DataCoarseAggregateHnl data_jgcl_ss_sshlszhnlBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSZHNLBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料含泥量
                    if (data_jgcl_ss_sshlszhnlBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSZHNL(dataCoarseHnl);
                    } else {
                        //修改粗骨料含泥量
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSZHNL(dataCoarseHnl);
                    }

                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseHnl.getJcrq();

                        defaultUc.setConclusion(coarseHnl.getDxjl());
                        defaultUc.setUcResultValue(coarseHnl.getDxjl());
                        defaultUc.setUcTestValue(coarseHnl.getHnlpjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "hnl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNKL.getCode())) {
                //含泥块量
                CoarseAggregateHnkl coarseHnkl = objJson.toJavaObject(CoarseAggregateHnkl.class);
                DataCoarseAggregateHnkl dataCoarseHnkl = new DataCoarseAggregateHnkl();

                if (coarseHnkl != null) {
                    List<CoarseAggregateHnkl.HnklInfo> hnklInfo = coarseHnkl.getHnkInfo();
                    if (CollectionUtil.isNotEmpty(hnklInfo)) {
                        if (!hnklInfo.isEmpty()) {
                            CoarseAggregateHnkl.HnklInfo hnlInfoOne = hnklInfo.get(0);
                            dataCoarseHnkl.setS1(NullUtils.ifNull(hnlInfoOne.getHqsyzl()));
                            dataCoarseHnkl.setS2(NullUtils.ifNull(hnlInfoOne.getHhsyzl()));
                            dataCoarseHnkl.setS3(NullUtils.ifNull(hnlInfoOne.getHnl()));
                        }
                        if (hnklInfo.size() > 1) {
                            CoarseAggregateHnkl.HnklInfo hnlInfoTwo = hnklInfo.get(1);
                            dataCoarseHnkl.setS4(NullUtils.ifNull(hnlInfoTwo.getHqsyzl()));
                            dataCoarseHnkl.setS5(NullUtils.ifNull(hnlInfoTwo.getHhsyzl()));
                            dataCoarseHnkl.setS6(NullUtils.ifNull(hnlInfoTwo.getHnl()));
                        }
                    }
                    if (coarseHnkl.getHnlpjz() != null && !coarseHnkl.getHnlpjz().isEmpty()) {
                        dataCoarseHnkl.setS7(coarseHnkl.getHnlpjz());
                    }

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNKL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseHnkl, "骨料检测室", coarseHnkl.getJcrq(), detail);

                    //根据样品编码查询粗骨料含泥量
                    Map<String, Object> data_jgcl_ss_sshlszhnlBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSZNKHLBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料含泥量
                    if (data_jgcl_ss_sshlszhnlBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSZNKHL(dataCoarseHnkl);
                    } else {
                        //修改粗骨料含泥量
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSZNKHL(dataCoarseHnkl);
                    }

                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseHnkl.getJcrq();

                        defaultUc.setConclusion(coarseHnkl.getDxjl());
                        defaultUc.setUcResultValue(coarseHnkl.getDxjl());
                        defaultUc.setUcTestValue(coarseHnkl.getHnlpjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNKL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_HNKL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "nkhlzhe");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_ZPZKLHL.getCode())) {
                //针、片状颗粒含量
                CoarseAggregateZpzklhl coarseZpzklhl = objJson.toJavaObject(CoarseAggregateZpzklhl.class);
                DataCoarseAggregateZpzklhl dataCoarseZpzklhl = new DataCoarseAggregateZpzklhl();

                if (coarseZpzklhl != null) {
                    dataCoarseZpzklhl.setS1(NullUtils.ifNull(coarseZpzklhl.getSyzl()));
                    dataCoarseZpzklhl.setS2(NullUtils.ifNull(coarseZpzklhl.getZpzklzzl()));
                    dataCoarseZpzklhl.setS3(NullUtils.ifNull(coarseZpzklhl.getZpzkklhl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_ZPZKLHL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseZpzklhl, "骨料检测室", coarseZpzklhl.getJcrq(), detail);

                    //根据样品编码查询粗骨料针、片状颗粒含量
                    Map<String, Object> data_jgcl_ss_sshlszhnlBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSZZZHPZKLZHLBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料针、片状颗粒含量
                    if (data_jgcl_ss_sshlszhnlBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSZZZHPZKLZHL(dataCoarseZpzklhl);
                    } else {
                        //修改粗骨料针、片状颗粒含量
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSZZZHPZKLZHL(dataCoarseZpzklhl);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseZpzklhl.getJcrq();

                        defaultUc.setConclusion(coarseZpzklhl.getDxjl());
                        defaultUc.setUcResultValue(coarseZpzklhl.getDxjl());
                        defaultUc.setUcTestValue(coarseZpzklhl.getZpzkklhl());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_ZPZKLHL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_ZPZKLHL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "zpzklhl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_SFX.getCode())) {
                //筛分析
                CoarseAggregateSfx coarseSfx = objJson.toJavaObject(CoarseAggregateSfx.class);
                DataCoarseAggregateKljp dataCoarseKljp = new DataCoarseAggregateKljp();

                if (coarseSfx != null) {
                    /**将材料规格拆分成两个字段给协会对应字段赋值**/
                    String[] xxs = experiment.getMaterialsSpecs().split("～");
                    for (int i = 0; i < xxs.length; i++) {
                        if (i == 0) {
                            dataCoarseKljp.setXx(xxs[0].replace("(", ""));
                        }
                        if (i == 1) {
                            dataCoarseKljp.setSx(xxs[1].replace(")mm", ""));
                        }
                    }
                    coarseSfx.setSfxJson(experiment, coarseSfx, dataCoarseKljp);
                    ConvertUtils.setFieldsToNullIfEmpty(dataCoarseKljp);
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_SFX.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    dataCoarseKljp.setConclusion(coarseSfx.getDxjl());

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseKljp, "骨料检测室", coarseSfx.getJcrq(), detail);

                    //根据样品编码查询粗骨料筛分析
                    Map<String, Object> data_jgcl_ss_sshlsdsfxBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSDSFXBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料筛分析
                    if (data_jgcl_ss_sshlsdsfxBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSDSFX(dataCoarseKljp);
                    } else {
                        //修改粗骨料筛分析
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSDSFX(dataCoarseKljp);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseSfx.getJcrq();

                        defaultUc.setConclusion(coarseSfx.getDxjl());
                        defaultUc.setUcResultValue(coarseSfx.getDxjl());
                        defaultUc.setUcTestValue(coarseSfx.getDxjl());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_SFX.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_SFX.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "sfx");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_YSZZB.getCode())) {
                //压碎值指标
                CoarseAggregateYszzb coarseYszzb = objJson.toJavaObject(CoarseAggregateYszzb.class);
                DataCoarseAggregateYszzb dataCoarseYszzb = new DataCoarseAggregateYszzb();

                if (coarseYszzb != null) {
                    List<CoarseAggregateYszzb.YszzbInfo> yszzbInfo = coarseYszzb.getYszzbInfo();
                    if (CollectionUtil.isNotEmpty(yszzbInfo)) {
                        if (yszzbInfo.size() > 0) {
                            CoarseAggregateYszzb.YszzbInfo yszzbInfoOne = yszzbInfo.get(0);
                            dataCoarseYszzb.setS1(NullUtils.ifNull(yszzbInfoOne.getSyzl()));
                            dataCoarseYszzb.setS2(NullUtils.ifNull(yszzbInfoOne.getYssyl()));
                            dataCoarseYszzb.setS3(NullUtils.ifNull(yszzbInfoOne.getJg()));
                        }
                        if (yszzbInfo.size() > 1) {
                            CoarseAggregateYszzb.YszzbInfo yszzbInfoTwo = yszzbInfo.get(1);
                            dataCoarseYszzb.setS4(NullUtils.ifNull(yszzbInfoTwo.getSyzl()));
                            dataCoarseYszzb.setS5(NullUtils.ifNull(yszzbInfoTwo.getYssyl()));
                            dataCoarseYszzb.setS6(NullUtils.ifNull(yszzbInfoTwo.getJg()));
                        }
                        if (yszzbInfo.size() > 2) {
                            CoarseAggregateYszzb.YszzbInfo yszzbInfoThree = yszzbInfo.get(2);
                            dataCoarseYszzb.setS7(NullUtils.ifNull(yszzbInfoThree.getSyzl()));
                            dataCoarseYszzb.setS8(NullUtils.ifNull(yszzbInfoThree.getYssyl()));
                            dataCoarseYszzb.setS9(NullUtils.ifNull(yszzbInfoThree.getJg()));
                        }
                    }
                    dataCoarseYszzb.setS10(NullUtils.ifNull(coarseYszzb.getPjz()));


                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_YSZZB.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseYszzb, "骨料检测室", coarseYszzb.getJcrq(), detail);

                    //根据样品编码查询粗骨料压碎值指标
                    Map<String, Object> data_jgcl_ss_sshlsdyszzbBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSDYSZZBBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料压碎值指标
                    if (data_jgcl_ss_sshlsdyszzbBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSDYSZZB(dataCoarseYszzb);
                    } else {
                        //修改粗骨料压碎值指标
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSDYSZZB(dataCoarseYszzb);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseYszzb.getJcrq();

                        defaultUc.setConclusion(coarseYszzb.getDxjl());
                        defaultUc.setUcResultValue(coarseYszzb.getDxjl());
                        defaultUc.setUcTestValue(coarseYszzb.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_YSZZB.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_YSZZB.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "yszzb");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_BGMD.getCode())) {
                //表观密度
                CoarseAggregateBgmd coarseBgmd = objJson.toJavaObject(CoarseAggregateBgmd.class);
                DataCoarseAggregateBgmd dataCoarseBgmd = new DataCoarseAggregateBgmd();

                if (coarseBgmd != null) {
                    dataCoarseBgmd.setS1(NullUtils.ifNull(coarseBgmd.getSw()));
                    dataCoarseBgmd.setS2(NullUtils.ifNull(coarseBgmd.getXzxs()));
                    List<CoarseAggregateBgmd.BgmdInfo> bgmdInfo = coarseBgmd.getBgmdInfo();
                    if (CollectionUtil.isNotEmpty(bgmdInfo)) {
                        if (!bgmdInfo.isEmpty()) {
                            CoarseAggregateBgmd.BgmdInfo bgmdInfoOne = bgmdInfo.get(0);
                            dataCoarseBgmd.setS3(NullUtils.ifNull(bgmdInfoOne.getHgsyzl()));
                            dataCoarseBgmd.setS4(NullUtils.ifNull(bgmdInfoOne.getZzlssydl()));
                            dataCoarseBgmd.setS5(NullUtils.ifNull(bgmdInfoOne.getZzlsdl()));
                            dataCoarseBgmd.setS6(NullUtils.ifNull(bgmdInfoOne.getJg()));
                        }
                        if (bgmdInfo.size() > 1) {
                            CoarseAggregateBgmd.BgmdInfo bgmdInfoTwo = bgmdInfo.get(1);
                            dataCoarseBgmd.setS7(NullUtils.ifNull(bgmdInfoTwo.getHgsyzl()));
                            dataCoarseBgmd.setS8(NullUtils.ifNull(bgmdInfoTwo.getZzlssydl()));
                            dataCoarseBgmd.setS9(NullUtils.ifNull(bgmdInfoTwo.getZzlsdl()));
                            dataCoarseBgmd.setS10(NullUtils.ifNull(bgmdInfoTwo.getJg()));
                        }
                    }
                    dataCoarseBgmd.setS11(NullUtils.ifNull(coarseBgmd.getPjz()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_BGMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseBgmd, "骨料检测室", coarseBgmd.getJcrq(), detail);

                    //根据样品编码查询粗骨料表观密度
                    Map<String, Object> data_jgcl_ss_sshlszhnlBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSDBGMD_JYFBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料表观密度
                    if (data_jgcl_ss_sshlszhnlBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSDBGMD_JYF(dataCoarseBgmd);
                    } else {
                        //修改粗骨料表观密度
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSDBGMD_JYF(dataCoarseBgmd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseBgmd.getJcrq();

                        defaultUc.setConclusion(coarseBgmd.getDxjl());
                        defaultUc.setUcResultValue(coarseBgmd.getDxjl());
                        defaultUc.setUcTestValue(coarseBgmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_BGMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_BGMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "bgmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_DJMD.getCode())) {
                //堆积密度
                CoarseAggregateDjmd coarseDjmd = objJson.toJavaObject(CoarseAggregateDjmd.class);
                DataCoarseAggregateDjmd dataCoarseDjmd = new DataCoarseAggregateDjmd();

                if (coarseDjmd != null) {
                    List<CoarseAggregateDjmd.DjmdInfo> djmdbInfo = coarseDjmd.getDjmdInfo();
                    if (CollectionUtil.isNotEmpty(djmdbInfo)) {
                        if (!djmdbInfo.isEmpty()) {
                            CoarseAggregateDjmd.DjmdInfo bgmdInfoOne = djmdbInfo.get(0);
                            dataCoarseDjmd.setS1(stringToDoubleAndDivide(coarseDjmd.getRltzl()));
                            dataCoarseDjmd.setS2(stringToDoubleAndDivide(bgmdInfoOne.getZzl()));
                            dataCoarseDjmd.setS3(NullUtils.ifNullFoSum(coarseDjmd.getRlttj()));
                            dataCoarseDjmd.setS4(NullUtils.ifNull(bgmdInfoOne.getJg()));
                        }
                        if (djmdbInfo.size() > 1) {
                            CoarseAggregateDjmd.DjmdInfo bgmdInfoTwo = djmdbInfo.get(1);
                            dataCoarseDjmd.setS5(stringToDoubleAndDivide(coarseDjmd.getRltzl()));
                            dataCoarseDjmd.setS6(stringToDoubleAndDivide(bgmdInfoTwo.getZzl()));
                            dataCoarseDjmd.setS7(NullUtils.ifNullFoSum(coarseDjmd.getRlttj()));
                            dataCoarseDjmd.setS8(NullUtils.ifNull(bgmdInfoTwo.getJg()));
                        }
                    }
                    dataCoarseDjmd.setS9(NullUtils.ifNull(coarseDjmd.getPjz()));
                    dataCoarseDjmd.setS10(NullUtils.ifNull(bgmd));
                    dataCoarseDjmd.setS11(NullUtils.ifNull(coarseDjmd.getKxl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_DJMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseDjmd, "骨料检测室", coarseDjmd.getJcrq(), detail);

                    //根据样品编码查询粗骨料堆积密度
                    Map<String, Object> data_jgcl_ss_sshlsddjmdBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSDDJMDBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料堆积密度
                    if (data_jgcl_ss_sshlsddjmdBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSDDJMD(dataCoarseDjmd);
                    } else {
                        //修改粗骨料堆积密度
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSDDJMD(dataCoarseDjmd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseDjmd.getJcrq();

                        defaultUc.setConclusion(coarseDjmd.getDxjl());
                        defaultUc.setUcResultValue(coarseDjmd.getDxjl());
                        defaultUc.setUcTestValue(coarseDjmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_DJMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_DJMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "djmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_JMMD.getCode())) {
                //紧密密度
                CoarseAggregateJmmd coarseJmmd = objJson.toJavaObject(CoarseAggregateJmmd.class);
                DataCoarseAggregateJmmd dataCoarseJmmd = new DataCoarseAggregateJmmd();

                if (coarseJmmd != null) {
                    List<CoarseAggregateJmmd.JmmdInfo> jmmdInfo = coarseJmmd.getJmmdInfo();
                    if (CollectionUtil.isNotEmpty(jmmdInfo)) {
                        if (!jmmdInfo.isEmpty()) {
                            CoarseAggregateJmmd.JmmdInfo jmmdInfoOne = jmmdInfo.get(0);

                            if (jmmdInfoOne != null) {
                                dataCoarseJmmd.setS1(stringToDoubleAndDivide(coarseJmmd.getRltzl()));
                                dataCoarseJmmd.setS2(stringToDoubleAndDivide(jmmdInfoOne.getZzl()));
                                dataCoarseJmmd.setS3(NullUtils.ifNullFoSum(coarseJmmd.getRlttj()));
                                dataCoarseJmmd.setS4(NullUtils.ifNull(jmmdInfoOne.getJg()));
                            }
                        }
                        if (jmmdInfo.size() > 1) {
                            CoarseAggregateJmmd.JmmdInfo jmmdInfoTwo = jmmdInfo.get(1);

                            if (jmmdInfoTwo != null) {
                                dataCoarseJmmd.setS5(stringToDoubleAndDivide(coarseJmmd.getRltzl()));
                                dataCoarseJmmd.setS6(stringToDoubleAndDivide(jmmdInfoTwo.getZzl()));
                                dataCoarseJmmd.setS7(NullUtils.ifNullFoSum(coarseJmmd.getRlttj()));
                                dataCoarseJmmd.setS8(NullUtils.ifNull(jmmdInfoTwo.getJg()));
                            }
                        }
                    }
                    dataCoarseJmmd.setS9(NullUtils.ifNull(coarseJmmd.getPjz()));
                    dataCoarseJmmd.setS10(NullUtils.ifNull(bgmd));
                    dataCoarseJmmd.setS11(NullUtils.ifNull(coarseJmmd.getKxl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_JMMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataCoarseJmmd, "骨料检测室", coarseJmmd.getJcrq(), detail);

                    //根据样品编码查询粗骨料紧密密度
                    Map<String, Object> data_jgcl_ss_sshlsdjmmdBySampleNo = coarseLaboratoryMapper.findDATA_JGCL_SS_SSHLSDJMMDBySampleNo(sampleNo);
                    //查询没值说明需要  新增粗骨料紧密密度
                    if (data_jgcl_ss_sshlsdjmmdBySampleNo == null) {
                        coarseLaboratoryMapper.addDATA_JGCL_SS_SSHLSDJMMD(dataCoarseJmmd);
                    } else {
                        //修改粗骨料紧密密度
                        coarseLaboratoryMapper.updateDATA_JGCL_SS_SSHLSDJMMD(dataCoarseJmmd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = coarseJmmd.getJcrq();

                        defaultUc.setConclusion(coarseJmmd.getDxjl());
                        defaultUc.setUcResultValue(coarseJmmd.getDxjl());
                        defaultUc.setUcTestValue(coarseJmmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_JMMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.COARSE_AGGREGATE_PARAM_CGL_JMMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "jmmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "骨料检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
        }
    }

    //保存/完成台账矿渣粉 试验结果 同步至上海协会
    private void finishSlagTest(String sampleNo, List<ExperimentDetail> experimentDetailList, Experiment experiment, String samId) {
        //查询品控配置
        /**获取所有矿渣粉 批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.SLAG.getCode()));

        //查询出品控的矿渣粉试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.SLAG.getTestProjectType()));

        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.SLAG.getTestProjectType()));


        //循环试验结果数据
        for (ExperimentDetail detail : experimentDetailList) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //密度
            if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_YPMD.getCode())) {
                //将json转成对象
                SlagYpmd slagYpmd = objJson.toJavaObject(SlagYpmd.class);

                //创建协会矿渣粉密度对象
                DataSlagMd dataSlagMd = new DataSlagMd();

                if (slagYpmd != null) {
                    dataSlagMd.setMiDuPingJun(NullUtils.ifNull(slagYpmd.getPjz()));
                    dataSlagMd.setConclusion(NullUtils.ifNull(slagYpmd.getDxjl()));
                    int con = 1;
                    for (SlagYpmd.YpmdInfo ypmdInfo : slagYpmd.getYpmdInfo()) {
                        if (con == 1) {
                            dataSlagMd.setShuiNiZhiLiang1(NullUtils.ifNull(ypmdInfo.getSyzl()));
                            dataSlagMd.setWeiZhuangYeMian1(NullUtils.ifNull(ypmdInfo.getDycdsv1()));
                            dataSlagMd.setYiZhuangYeMian1(NullUtils.ifNull(ypmdInfo.getDecdsv2()));
                            dataSlagMd.setMiDu1(NullUtils.ifNull(ypmdInfo.getSyzl()));
                        } else if (con == 2) {
                            dataSlagMd.setShuiNiZhiLiang2(NullUtils.ifNull(ypmdInfo.getSyzl()));
                            dataSlagMd.setWeiZhuangYeMian2(NullUtils.ifNull(ypmdInfo.getDycdsv1()));
                            dataSlagMd.setYiZhuangYeMian2(NullUtils.ifNull(ypmdInfo.getDecdsv2()));
                            dataSlagMd.setMiDu2(NullUtils.ifNull(ypmdInfo.getSyzl()));
                        }
                        con++;
                    }

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_YPMD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSlagMd, "化学检测室", slagYpmd.getJcrq(), detail);

                    //根据样品编码查询矿渣粉密度
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = slagLaboratoryMapper.findDATA_YCL_KF_MDBySampleNo(sampleNo);
                    //查询没值说明需要  新增矿渣粉密度
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        slagLaboratoryMapper.addDATA_YCL_KF_MD(dataSlagMd);
                    } else {
                        //修改矿渣粉密度
                        slagLaboratoryMapper.updateDATA_YCL_KF_MD(dataSlagMd);
                    }


                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = slagYpmd.getJcrq();
                        defaultUc.setConclusion(slagYpmd.getDxjl());
                        defaultUc.setUcResultValue(slagYpmd.getDxjl());
                        defaultUc.setUcTestValue(slagYpmd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_YPMD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }

                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.SLAG_PARAM_KZF_YPMD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "ypmd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id


                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                    }
                }
                //烧失量
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_SSL.getCode())) {
                //将json转成对象
                SlagSsl slagSsl = objJson.toJavaObject(SlagSsl.class);

                //创建协会矿渣粉烧失量对象
                DataSlagSsl dataSlagSsl = new DataSlagSsl();

                if (slagSsl != null) {
                    dataSlagSsl.setShaoShiLiangPingJun(NullUtils.ifNull(slagSsl.getSslpjz()));
                    dataSlagSsl.setShaoShiLiangJiaoZhen(NullUtils.ifNull(slagSsl.getSsljzz()));
                    int con = 1;
                    for (SlagSsl.SslInfo sslInfo : slagSsl.getSslInfo()) {
                        if (con == 1) {
                            dataSlagSsl.setQmZl1(NullUtils.ifNull(sslInfo.getClqmzl()));
                            dataSlagSsl.setYQmZl1(NullUtils.ifNull(sslInfo.getSlclqmzl()));
                            dataSlagSsl.setSlZl1(NullUtils.ifNull(sslInfo.getSlzl()));
                            dataSlagSsl.setCqgZl1(NullUtils.ifNull(sslInfo.getCggzl()));
                            dataSlagSsl.setZhuoShaoHouSYCqgZl1(NullUtils.ifNull(sslInfo.getZshcggzl()));
                            dataSlagSsl.setZhuoShaoHouSyZl1(NullUtils.ifNull(sslInfo.getZshsyzl()));
                            dataSlagSsl.setShaoShiLiang1(NullUtils.ifNull(sslInfo.getSsl()));
                        } else if (con == 2) {
                            dataSlagSsl.setQmZl2(NullUtils.ifNull(sslInfo.getClqmzl()));
                            dataSlagSsl.setYQmZl2(NullUtils.ifNull(sslInfo.getSlclqmzl()));
                            dataSlagSsl.setSlZl2(NullUtils.ifNull(sslInfo.getSlzl()));
                            dataSlagSsl.setCqgZl2(NullUtils.ifNull(sslInfo.getCggzl()));
                            dataSlagSsl.setZhuoShaoHouSYCqgZl2(NullUtils.ifNull(sslInfo.getZshcggzl()));
                            dataSlagSsl.setZhuoShaoHouSyZl2(NullUtils.ifNull(sslInfo.getZshsyzl()));
                            dataSlagSsl.setShaoShiLiang2(NullUtils.ifNull(sslInfo.getSsl()));
                        }
                        con++;
                    }
                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_SSL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSlagSsl, "化学检测室", slagSsl.getJcrq(), detail);

                    //根据样品编码查询矿渣粉烧失量
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = slagLaboratoryMapper.findDATA_YCL_KF_SSLBySampleNo(sampleNo);
                    //查询没值说明需要  新增矿渣粉烧失量
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        slagLaboratoryMapper.addDATA_YCL_KF_SSL(dataSlagSsl);
                    } else {
                        //修改矿渣粉烧失量
                        slagLaboratoryMapper.updateDATA_YCL_KF_SSL(dataSlagSsl);
                    }


                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = slagSsl.getJcrq();
                        defaultUc.setConclusion("合格");
                        defaultUc.setUcResultValue("合格");
                        defaultUc.setUcTestValue(slagSsl.getSslpjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_SSL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }

                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.SLAG_PARAM_KZF_SSL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "ssl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id


                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                    }
                }
                //流动度比
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_LDDB.getCode())) {
                //将json转成对象
                SlagLddb slagLddb = objJson.toJavaObject(SlagLddb.class);

                //创建协会矿渣粉流动度比对象
                DataSlagLddb dataSlagLddb = new DataSlagLddb();

                if (slagLddb != null) {
                    if (slagLddb.getDbjsldd() != null) {
                        dataSlagLddb.setDbYPLDD(NullUtils.ifNull(slagLddb.getDbjsldd().getLdd()));
                    }

                    if (slagLddb.getSyjsldd() != null) {
                        dataSlagLddb.setSyYPLDD(NullUtils.ifNull(slagLddb.getSyjsldd().getLdd()));
                    }

                    dataSlagLddb.setConclusion(NullUtils.ifNull(slagLddb.getDxjl()));
                    dataSlagLddb.setLDDB(NullUtils.ifNull(slagLddb.getSyjg()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_LDDB.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSlagLddb, "化学检测室", slagLddb.getJcrq(), detail);

                    //根据样品编码查询矿渣粉流动度比
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = slagLaboratoryMapper.findDATA_YCL_KF_LDDBBySampleNo(sampleNo);
                    //查询没值说明需要  新增矿渣粉流动度比
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        slagLaboratoryMapper.addDATA_YCL_KF_LDDB(dataSlagLddb);
                    } else {
                        //修改矿渣粉流动度比
                        slagLaboratoryMapper.updateDATA_YCL_KF_LDDB(dataSlagLddb);
                    }


                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = slagLddb.getJcrq();
                        defaultUc.setConclusion(slagLddb.getDxjl());
                        defaultUc.setUcResultValue(slagLddb.getDxjl());
                        defaultUc.setUcTestValue(slagLddb.getSyjg());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_LDDB.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }

                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.SLAG_PARAM_KZF_LDDB.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "lddb");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id


                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                    }
                }
                //含水率
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_HSL.getCode())) {
                //将json转成对象
                SlagHsl slagHsl = objJson.toJavaObject(SlagHsl.class);

                //创建协会矿渣粉含水率对象
                DataSlagHsl dataSlagHsl = new DataSlagHsl();


                if (slagHsl != null) {
                    dataSlagHsl.setConclusion(NullUtils.ifNull(slagHsl.getDxjl()));
                    dataSlagHsl.setCLQMZhiLiang(NullUtils.ifNull(slagHsl.getClqmzl()));
                    dataSlagHsl.setClQMSHIJianZhiLiang(NullUtils.ifNull(slagHsl.getSlclqmzl()));
                    dataSlagHsl.setChengYang(NullUtils.ifNull(slagHsl.getCyzl()));
                    dataSlagHsl.setHongGanHouSLQMZhiLiang(NullUtils.ifNull(slagHsl.getHghclqmzl()));
                    dataSlagHsl.setHongGanHouSlZhiLiang(NullUtils.ifNull(slagHsl.getHghsyzl()));
                    dataSlagHsl.setHanShuiLv(NullUtils.ifNull(slagHsl.getHsl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_HSL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSlagHsl, "化学检测室", slagHsl.getJcrq(), detail);

                    //根据样品编码查询粉煤灰含水率
                    Map<String, Object> data_ycl_fmh_adxBySampleNo = slagLaboratoryMapper.findDATA_YCL_KF_HSLBySampleNo(sampleNo);
                    //查询没值说明需要  新增粉煤灰含水率
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        slagLaboratoryMapper.addDATA_YCL_KF_HSL(dataSlagHsl);
                    } else {
                        //修改粉煤灰安含水率
                        slagLaboratoryMapper.updateDATA_YCL_KF_HSL(dataSlagHsl);
                    }


                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = slagHsl.getJcrq();
                        defaultUc.setConclusion(slagHsl.getDxjl());
                        defaultUc.setUcResultValue(slagHsl.getDxjl());
                        defaultUc.setUcTestValue(slagHsl.getHsl());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_HSL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }

                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.SLAG_PARAM_KZF_HSL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "hsl");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id


                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                    }
                }

                //活性指数  矿渣粉活性指数不应该上传   只需要下载
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_HXZS.getCode())) {

                SlagHdzs slagHdzs = objJson.toJavaObject(SlagHdzs.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            for (String s : testProjectInfo.getParameterName().split(",")) {
                                //添加进协会需要做的项目集合
                                set.add(s);
                            }
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    List<SlagHdzs.HxzsInfoList> hxzsInfoList = slagHdzs.getHxzsInfoList();
                    if (CollectionUtil.isNotEmpty(hxzsInfoList)) {
                        if (hxzsInfoList.size() > 0) {
                            SlagHdzs.HxzsInfoList hxzsInfn1 = hxzsInfoList.get(0);
                            if (str.contains("7d")) {
                                jcrq = hxzsInfn1.getJcrq();
                                defaultUc.setConclusion(hxzsInfn1.getDxjl());
                                defaultUc.setUcResultValue(hxzsInfn1.getDxjl());
                                defaultUc.setUcTestValue(hxzsInfn1.getHxzs());
                            }
                        }
                        if (hxzsInfoList.size() > 1) {
                            SlagHdzs.HxzsInfoList hxzsInfn2 = hxzsInfoList.get(1);
                            if (str.contains("28d")) {
                                jcrq = hxzsInfn2.getJcrq();
                                defaultUc.setConclusion(hxzsInfn2.getDxjl());
                                defaultUc.setUcResultValue(hxzsInfn2.getDxjl());
                                defaultUc.setUcTestValue(hxzsInfn2.getHxzs());
                            }
                        }
                    }


                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";

                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_HXZS.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }

                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.SLAG_PARAM_KZF_HXZS.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                if (str.contains("7d")) {
                                    setUcStandardValue(defaultUc, json, "hxzs7d");
                                } else if (str.contains("28d")) {
                                    setUcStandardValue(defaultUc, json, "hxzs28d");
                                }

                            }
                        }
                    }


                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id


                    //查询data_defalutUc 是否存在
                    Map<String, Object> data_defaultUCBySampleNo = dataDefUcLaboratoryMapper.findDATA_DefaultUCBySampleNo(sampleNo, parameterID);
                    if (data_defaultUCBySampleNo == null) {
                        //新增
                        dataDefUcLaboratoryMapper.addDATA_DefaultUC(defaultUc);
                    } else {
                        //修改
                        dataDefUcLaboratoryMapper.updateDATA_DefaultUC(defaultUc);
                    }

                }

                //比表面积
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_BBMJ.getCode())) {

                SlagBbmj slagBbmj = objJson.toJavaObject(SlagBbmj.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            //添加进协会需要做的项目集合
                            set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    jcrq = slagBbmj.getJcrq();
                    defaultUc.setConclusion(slagBbmj.getDxjl());
                    defaultUc.setUcResultValue(slagBbmj.getDxjl());
                    defaultUc.setUcTestValue(slagBbmj.getPjz());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";

                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_BBMJ.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }

                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.SLAG_PARAM_KZF_BBMJ.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "bbmj");
                            }
                        }
                    }


                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id


                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                }
                //三氧化硫
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_SYHL.getCode())) {

                SlagSyhl slagSyhl = objJson.toJavaObject(SlagSyhl.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            //添加进协会需要做的项目集合
                            set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    jcrq = slagSyhl.getJcrq();
                    defaultUc.setConclusion(slagSyhl.getDxjl());
                    defaultUc.setUcResultValue(slagSyhl.getDxjl());
                    defaultUc.setUcTestValue(slagSyhl.getPjz());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";

                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.SLAG_PARAM_KZF_SYHL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }

                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.SLAG_PARAM_KZF_SYHL.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "syhl");

                            }
                        }
                    }

                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id


                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                }
            }
        }
    }

    //保存/完成台账粉煤灰 试验结果 同步至上海协会
    private void finishFlyTest(String sampleNo, List<ExperimentDetail> experimentDetailList, Experiment experiment, String samId) {
        //查询品控配置
        /**获取所有粉煤灰批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.FLY.getCode()));
        //查询出品控的矿渣粉试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.FLY.getTestProjectType()));
        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.FLY.getTestProjectType()));

        //循环试验结果数据
        for (ExperimentDetail detail : experimentDetailList) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //安定性
            if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_ADX.getCode())) {
                //将json转成对象
                FlyAskAdx flyAskAdx = objJson.toJavaObject(FlyAskAdx.class);

                //创建协会粉煤灰安定性对象
                DataFlyAdx dataFlyAdx = new DataFlyAdx();


                dataFlyAdx.setAnDingXingFangFa("雷氏法");

                if (flyAskAdx != null) {
                    if (flyAskAdx.getLsf() != null) {
                        dataFlyAdx.setPingJunZhi(NullUtils.ifNull(flyAskAdx.getLsf().getPjz()));
                        dataFlyAdx.setLeiShiFaJieGuo(NullUtils.ifNull(flyAskAdx.getLsf().getJl()));
                        dataFlyAdx.setConclusion(NullUtils.ifNull(flyAskAdx.getLsf().getJl()));
                        dataFlyAdx.setZhuQianJuLi1(NullUtils.ifNull(flyAskAdx.getLsf().getJza()));
                        dataFlyAdx.setZhuQianJuLi2(NullUtils.ifNull(flyAskAdx.getLsf().getJza1()));
                        dataFlyAdx.setZhuHouJiLi1(NullUtils.ifNull(flyAskAdx.getLsf().getJzc()));
                        dataFlyAdx.setZhuHouJiLi2(NullUtils.ifNull(flyAskAdx.getLsf().getJzc1()));
                        dataFlyAdx.setZhengJiaJuli1(NullUtils.ifNull(flyAskAdx.getLsf().getZjjl()));
                        dataFlyAdx.setZhengJiaJuli2(NullUtils.ifNull(flyAskAdx.getLsf().getZjjl1()));

                        //判断依据
                        String judgeGist = "";
                        //试验依据
                        String experimentGist = "";


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_ADX.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                dataFlyAdx.setBiaoZhunZhi(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                            }
                        }


                        //设置公共属性
                        setCommonProperties(sampleNo, experiment, dataFlyAdx, "化学检测室", flyAskAdx.getJcrq(), detail);


                        //根据样品编码查询粉煤灰安定性
                        DataFlyAdx data_ycl_fmh_adxBySampleNo = flyAshLaboratoryMapper.findDATA_YCL_FMH_ADXBySampleNo(sampleNo);
                        //查询没值说明需要  新增粉煤灰安定性
                        if (data_ycl_fmh_adxBySampleNo == null) {
                            flyAshLaboratoryMapper.addDATA_YCL_FMH_ADX(dataFlyAdx);
                        } else {
                            //修改粉煤灰安定性值
                            flyAshLaboratoryMapper.updateDATA_YCL_FMH_ADX(dataFlyAdx);
                        }


                        //存储协会需要做的项目集合
                        Set<String> set = new HashSet<>();

                        for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                            if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                                if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                    //添加进协会需要做的项目集合
                                    set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                                }
                            }
                        }

                        for (String str : set) {
                            DataDefaultUc defaultUc = new DataDefaultUc();

                            Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                            if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                                log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                                continue;
                            }
                            String parameterID = itemParameter.get("ParameterID").toString();

                            String jcrq = null;

                            jcrq = flyAskAdx.getJcrq();
                            defaultUc.setConclusion(flyAskAdx.getLsf().getJl());
                            defaultUc.setUcResultValue(flyAskAdx.getLsf().getJl());
                            defaultUc.setUcTestValue(flyAskAdx.getLsf().getPjz());


                            //获取标准值
                            for (CheckBatchConfig projectInfo : batchConfigList) {
                                if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_ADX.getCode())) {
                                    judgeGist = projectInfo.getJudgeGist();
                                    experimentGist = projectInfo.getExperimentGist();
                                    defaultUc.setUcStandardValue(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                                    defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                                }
                            }

                            //根据物料信息设置判断配置
                            for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                                if (TestProjectEnum.FLY_ASK_PARAM_FMH_ADX.getCode().equals(test.getTestProjectCode())) {
                                    if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                        String json = test.getObjJson();
                                        setUcStandardValue(defaultUc, json, "adx");
                                    }
                                }
                            }

                            //赋值
                            setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                            defaultUc.setUcParameterID(parameterID);//项目id

                            //新增或修改DataDefaultUc
                            insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                        }
                    }
                }
                //含水率
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_HSL.getCode())) {
                //将json转成对象
                FlyAskHsl flyAskHsl = objJson.toJavaObject(FlyAskHsl.class);

                //创建协会粉煤灰含水率对象
                DataFlyHsl dataFlyHsl = new DataFlyHsl();

                if (flyAskHsl != null) {
                    dataFlyHsl.setConclusion(NullUtils.ifNull(flyAskHsl.getDxjl()));
                    dataFlyHsl.setCLQMZhiLiang(NullUtils.ifNull(flyAskHsl.getClqmzl()));
                    dataFlyHsl.setClQMSHIJianZhiLiang(NullUtils.ifNull(flyAskHsl.getSlclqmzl()));
                    dataFlyHsl.setChengYang(NullUtils.ifNull(flyAskHsl.getCyzl()));
                    dataFlyHsl.setHongGanHouSLQMZhiLiang(NullUtils.ifNull(flyAskHsl.getHghclqmzl()));
                    dataFlyHsl.setHongGanHouSlZhiLiang(NullUtils.ifNull(flyAskHsl.getHghsyzl()));
                    dataFlyHsl.setHanShuiLv(NullUtils.ifNull(flyAskHsl.getHsl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_HSL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFlyHsl, "化学检测室", flyAskHsl.getJcrq(), detail);


                    //根据样品编码查询粉煤灰含水率
                    DataFlyHsl data_ycl_fmh_adxBySampleNo = flyAshLaboratoryMapper.findDATA_YCL_FMH_HSLBySampleNo(sampleNo);
                    //查询没值说明需要  新增粉煤灰含水率
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        flyAshLaboratoryMapper.addDATA_YCL_FMH_HSL(dataFlyHsl);
                    } else {
                        //修改粉煤灰安含水率
                        flyAshLaboratoryMapper.updateDATA_YCL_FMH_HSL(dataFlyHsl);
                    }


                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = flyAskHsl.getJcrq();
                        defaultUc.setConclusion(flyAskHsl.getDxjl());
                        defaultUc.setUcResultValue(flyAskHsl.getDxjl());
                        defaultUc.setUcTestValue(flyAskHsl.getHsl());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_HSL.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcStandardValue(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }

                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FLY_ASK_PARAM_FMH_HSL.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "hsl");
                                }
                            }
                        }

                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                    }
                }
                //细度
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_XD.getCode())) {
                //将json转成对象
                FlyAskXd flyAskXd = objJson.toJavaObject(FlyAskXd.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            //添加进协会需要做的项目集合
                            set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    jcrq = flyAskXd.getJcrq();
                    defaultUc.setConclusion(flyAskXd.getDxjl());
                    defaultUc.setUcResultValue(flyAskXd.getDxjl());
                    defaultUc.setUcTestValue(flyAskXd.getJzhxddbz());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";


                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_XD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcStandardValue(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }

                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.FLY_ASK_PARAM_FMH_XD.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "xd");
                            }
                        }
                    }

                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id

                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                }
                //需水量比
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_XSLB.getCode())) {
                //将json转成对象
                FlyAskXslb flyAskXslb = objJson.toJavaObject(FlyAskXslb.class);

                DataFlyXslb dataFlyXslb = new DataFlyXslb();

                if (flyAskXslb != null) {
                    dataFlyXslb.setYPXuShuiLiang(NullUtils.ifNull(flyAskXslb.getFmhxsl()));
                    dataFlyXslb.setDbYpXuShuiLiang(NullUtils.ifNull(flyAskXslb.getSnxsl()));
                    dataFlyXslb.setXuShuiLiangBi(NullUtils.ifNull(flyAskXslb.getXslb()));
                    dataFlyXslb.setConclusion(NullUtils.ifNull(flyAskXslb.getDxjl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_XSLB.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataFlyXslb, "化学检测室", flyAskXslb.getJcrq(), detail);


                    //根据样品编码查询粉煤灰需水量比
                    DataFlyXslb data_ycl_fmh_adxBySampleNo = flyAshLaboratoryMapper.findDATA_YCL_FMH_XSLBBySampleNo(sampleNo);
                    //查询没值说明需要  新增粉煤灰需水量比
                    if (data_ycl_fmh_adxBySampleNo == null) {
                        flyAshLaboratoryMapper.addDATA_YCL_FMH_XSLB(dataFlyXslb);
                    } else {
                        //修改粉煤灰安需水量比
                        flyAshLaboratoryMapper.updateDATA_YCL_FMH_XSLB(dataFlyXslb);
                    }


                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = flyAskXslb.getJcrq();
                        defaultUc.setConclusion(flyAskXslb.getDxjl());
                        defaultUc.setUcResultValue(flyAskXslb.getDxjl());
                        defaultUc.setUcTestValue(flyAskXslb.getXslb());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_XSLB.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcStandardValue(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }

                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FLY_ASK_PARAM_FMH_XSLB.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "xslb");
                                }
                            }
                        }

                        //赋值
                        setDefUc(defaultUc, experiment, "化学检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                    }
                }
                //三氧化硫
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_SYHL.getCode())) {

                FlyAskSyhl flyAskSyhl = objJson.toJavaObject(FlyAskSyhl.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            //添加进协会需要做的项目集合
                            set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    jcrq = flyAskSyhl.getJcrq();
                    defaultUc.setConclusion(flyAskSyhl.getDxjl());
                    defaultUc.setUcResultValue(flyAskSyhl.getDxjl());
                    defaultUc.setUcTestValue(flyAskSyhl.getPjz());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";


                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_SYHL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcStandardValue(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }

                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.FLY_ASK_PARAM_FMH_SYHL.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "syhl");
                            }
                        }
                    }
                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id

                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                }

                //游离氧化钙
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_YLYHG.getCode())) {

                FlyAskYlyhg flyAskYlyhg = objJson.toJavaObject(FlyAskYlyhg.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            //添加进协会需要做的项目集合
                            set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    jcrq = flyAskYlyhg.getJcrq();
                    defaultUc.setConclusion(flyAskYlyhg.getDxjl());
                    defaultUc.setUcResultValue(flyAskYlyhg.getDxjl());
                    defaultUc.setUcTestValue(flyAskYlyhg.getPjz());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";

                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_YLYHG.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcStandardValue(NullUtils.ifNull(projectInfo.getUnQualifiedCheckOneValue()));
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }

                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.FLY_ASK_PARAM_FMH_YLYHG.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "ylyhg");

                            }
                        }
                    }

                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id

                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);
                }
                //烧失量
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_SSL.getCode())) {

                FlyAskSsl flyAskSsl = objJson.toJavaObject(FlyAskSsl.class);

                //存储协会需要做的项目集合
                Set<String> set = new HashSet<>();

                for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                    if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                        if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                            //添加进协会需要做的项目集合
                            set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                        }
                    }
                }

                for (String str : set) {
                    DataDefaultUc defaultUc = new DataDefaultUc();

                    Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                    if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                        log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                        continue;
                    }
                    String parameterID = itemParameter.get("ParameterID").toString();

                    String jcrq = null;

                    jcrq = flyAskSsl.getJcrq();

                    defaultUc.setConclusion(flyAskSsl.getDxjl());
                    defaultUc.setUcResultValue(flyAskSsl.getDxjl());
                    defaultUc.setUcTestValue(flyAskSsl.getSslpjz());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";

                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_SSL.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                            defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                        }
                    }


                    //根据物料信息设置判断配置
                    for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                        if (TestProjectEnum.FLY_ASK_PARAM_FMH_SSL.getCode().equals(test.getTestProjectCode())) {
                            if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                String json = test.getObjJson();
                                setUcStandardValue(defaultUc, json, "ssl");
                            }
                        }
                    }


                    //赋值
                    setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                    defaultUc.setUcParameterID(parameterID);//项目id

                    //新增或修改DataDefaultUc
                    insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                }
                //活性指数
            } else if (detail.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_HXZS.getCode())) {
                FlyAskHdzs flyAskHdzs = objJson.toJavaObject(FlyAskHdzs.class);

                if (flyAskHdzs != null && flyAskHdzs.getHxzsInfoList() != null && flyAskHdzs.getHxzsInfoList().size() != 0 && org.apache.commons.lang.StringUtils.isNotBlank(flyAskHdzs.getHxzsInfoList().get(0).getHxzs())) {
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = flyAskHdzs.getHxzsInfoList().get(0).getJcrq();

                        defaultUc.setConclusion(flyAskHdzs.getHxzsInfoList().get(0).getDxjl());
                        defaultUc.setUcResultValue(flyAskHdzs.getHxzsInfoList().get(0).getDxjl());
                        defaultUc.setUcTestValue(flyAskHdzs.getHxzsInfoList().get(0).getHxzs());

                        //判断依据
                        String judgeGist = "";
                        //试验依据
                        String experimentGist = "";

                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.FLY_ASK_PARAM_FMH_HXZS.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.FLY_ASK_PARAM_FMH_HXZS.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "hxzs7d");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "成型室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }

                }

            }
        }
    }

    //保存/完成台账水泥 试验结果 同步至上海协会
    private void finishCementTest(String sampleNo, List<ExperimentDetail> list, Experiment experiment, String samId) {
        //查询品控配置
        /**获取所有水泥批检配置信息*/
        List<CheckBatchConfig> batchConfigList = checkBatchConfigMapper.getList(new CheckBatchConfig().setIsDel(0).setProjectCategory(MaterialsEnum.CEMENT.getCode()));

        //查询出品控的水泥试验项目配置
        List<TestProjectInfo> testProjectInfoList = testProjectInfoMapper.getList(new TestProjectInfo().setTestType(MaterialsEnum.CEMENT.getTestProjectType()));
        //查询 试验项目材料规格判定配置
        List<TestProjectSpecConfig> testProjectSpecConfigList = testProjectSpecConfigMapper.getList(new TestProjectSpecConfig().setTestProjectType(MaterialsEnum.CEMENT.getTestProjectType()));


        //循环试验结果数据
        for (ExperimentDetail detail : list) {
            //品控试验json
            JSONObject objJson = detail.getObjJson();
            //安定性
            if (detail.getTestProjectCode().equals(CementEnum.ADX.getTestProjectType())) {

                //将json转成对象
                CementAdx cementAdx = objJson.toJavaObject(CementAdx.class);

                //创建协会水泥对象
                DataSnAdx dataSnAdx = new DataSnAdx();

                dataSnAdx.setTestMethod("饼法");
                if (cementAdx != null && cementAdx.getSbf() != null && cementAdx.getSbf().getJl() != null) {
                    dataSnAdx.setConclusion(cementAdx.getSbf().getJl());

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_ADX.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSnAdx, "水泥", cementAdx.getJcrq(), detail);


                    //根据样品编码查询水泥安定性
                    DataSnAdx data_jgcl_sn_adxBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_ADXBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥安定性
                    if (data_jgcl_sn_adxBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_ADX(dataSnAdx);
                    } else {
                        //修改水泥安定性值
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_ADX(dataSnAdx);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = cementAdx.getJcrq();

                        defaultUc.setConclusion(cementAdx.getSbf().getJl());
                        defaultUc.setUcResultValue(cementAdx.getSbf().getJl());
                        defaultUc.setUcTestValue(cementAdx.getSbf().getJl());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_ADX.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CEMENT_PARAM_ADX.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "sbf");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "水泥检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }

                //水泥标准稠度
            } else if (detail.getTestProjectCode().equals(CementEnum.BZCD.getTestProjectType())) {
                //将json转成对象
                CementBzcd cementBzcd = objJson.toJavaObject(CementBzcd.class);

                //创建协会水泥标准稠度合凝结时间对象
                DataSnBZCD_NJSJ dataSnBZCD_njsj = new DataSnBZCD_NJSJ();


                dataSnBZCD_njsj.setTestMethod("标准法");


                if (cementBzcd != null) {
                    dataSnBZCD_njsj.setS1(NullUtils.ifNull(cementBzcd.getYsl()));
                    dataSnBZCD_njsj.setS4(NullUtils.ifNull(cementBzcd.getBzcdysl()));
                    dataSnBZCD_njsj.setS2(NullUtils.ifNull(cementBzcd.getZssj()));
                    dataSnBZCD_njsj.setS3(NullUtils.ifNull(cementBzcd.getSgjdbjl()));

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_BZCD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSnBZCD_njsj, "水泥", cementBzcd.getJcrq(), detail);

                    //根据样品编码查询水泥标准稠度与初凝时间
                    DataSnBZCD_NJSJ data_jgcl_sn_bzcdnjsjBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_BZCDNJSJBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥标准稠度与初凝时间
                    if (data_jgcl_sn_bzcdnjsjBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_BZCDNJSJ(dataSnBZCD_njsj);
                    } else {
                        //修改水泥标准稠度与初凝时间
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_BZCDNJSJ(dataSnBZCD_njsj);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = cementBzcd.getJcrq();

                        defaultUc.setConclusion("合格");
                        defaultUc.setUcResultValue("合格");
                        defaultUc.setUcTestValue(cementBzcd.getBzcdysl());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_BZCD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CEMENT_PARAM_BZCD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "bzcd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "水泥检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }


                //水泥凝结时间
            } else if (detail.getTestProjectCode().equals(CementEnum.NJSJ.getTestProjectType())) {
                //将json转成对象
                CementNjsj cementNjsj = JsonUtils.getObject(objJson, CementNjsj.class);
                //创建协会水泥标准稠度合凝结时间对象
                DataSnBZCD_NJSJ dataSnBZCD_njsj = new DataSnBZCD_NJSJ();

                dataSnBZCD_njsj.setTestMethod("标准法");

                if (cementNjsj != null) {
                    if (cementNjsj.getNjsj() != null) {
                        dataSnBZCD_njsj.setS10(NullUtils.ifNull(cementNjsj.getNjsj().getXcsd()));
                        dataSnBZCD_njsj.setS5(NullUtils.ifNull(cementNjsj.getNjsj().getDdcnsj()));
                        dataSnBZCD_njsj.setS7(NullUtils.ifNull(cementNjsj.getNjsj().getDdznsj()));
                        dataSnBZCD_njsj.setS9(NullUtils.ifNull(cementNjsj.getNjsj().getJssj()));
                    }
                    if (cementNjsj.getJgjs() != null) {
                        dataSnBZCD_njsj.setS6(NullUtils.ifNull(cementNjsj.getJgjs().getCnsj()));
                        dataSnBZCD_njsj.setS8(NullUtils.ifNull(cementNjsj.getJgjs().getZnsj()));
                        dataSnBZCD_njsj.setConclusion(NullUtils.ifNull(cementNjsj.getJgjs().getCnsjjl()));
                        dataSnBZCD_njsj.setConclusion2(NullUtils.ifNull(cementNjsj.getJgjs().getZnsjjl()));
                    }

                    dataSnBZCD_njsj.setST1("45");
                    dataSnBZCD_njsj.setST2("600");

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_NJSJ.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSnBZCD_njsj, "水泥", cementNjsj.getJcrq(), detail);

                    //根据样品编码查询水泥标准稠度与初凝时间
                    DataSnBZCD_NJSJ data_jgcl_sn_bzcdnjsjBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_BZCDNJSJBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥标准稠度与初凝时间
                    if (data_jgcl_sn_bzcdnjsjBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_BZCDNJSJ(dataSnBZCD_njsj);
                    } else {
                        //修改水泥标准稠度与初凝时间
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_BZCDNJSJ(dataSnBZCD_njsj);
                    }
                }

                //水泥强度测定  不上传  只下载
          /*  } else if (detail.getTestProjectCode().equals(CementEnum.QDCD.getTestProjectType())) {

                //将json转成对象
                CementQdcd cementQdcd = JsonUtils.getObject(objJson, CementQdcd.class);
                //创建协会水泥抗压强度3d对象
                DataSnQDDJ3D dataSnQDDJ3D = new DataSnQDDJ3D();

                //判断依据
                String judgeGist = "";
                //试验依据
                String experimentGist = "";
                //获取标准值
                for (CheckBatchConfig projectInfo : batchConfigList) {
                    if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_QDCD.getCode())) {
                        judgeGist = projectInfo.getJudgeGist();
                        experimentGist = projectInfo.getExperimentGist();
                    }
                }


                if (cementQdcd != null) {
                    //抗折强度3d
                    if (cementQdcd.getKzqdsy3d() != null) {
                        if (cementQdcd.getKzqdsy3d().getDxjl() != null && !cementQdcd.getKzqdsy3d().getDxjl().isEmpty()) {
                            dataSnQDDJ3D.setConclusion(cementQdcd.getKzqdsy3d().getDxjl());
                        }
                        if (cementQdcd.getKzqdsy3d().getKzqdsyInfo() != null) {
                            int con = 1;
                            for (CementQdcd.KzqdsyInfo kzqdsyInfo : cementQdcd.getKzqdsy3d().getKzqdsyInfo()) {
                                if (con == 1) {
                                    if (kzqdsyInfo.getKzqd() != null && !kzqdsyInfo.getKzqd().isEmpty()) {
                                        dataSnQDDJ3D.setS1(kzqdsyInfo.getKzqd());
                                    }
                                } else if (con == 2) {
                                    if (kzqdsyInfo.getKzqd() != null && !kzqdsyInfo.getKzqd().isEmpty()) {
                                        dataSnQDDJ3D.setS2(kzqdsyInfo.getKzqd());
                                    }
                                } else if (con == 3) {
                                    if (kzqdsyInfo.getKzqd() != null && !kzqdsyInfo.getKzqd().isEmpty()) {
                                        dataSnQDDJ3D.setS3(kzqdsyInfo.getKzqd());
                                    }
                                }
                                con++;
                            }
                        }
                        if (cementQdcd.getKzqdsy3d().getPjz() != null && !cementQdcd.getKzqdsy3d().getPjz().isEmpty()) {
                            dataSnQDDJ3D.setS3(cementQdcd.getKzqdsy3d().getPjz());
                        }


                        //设置公共属性
                        setCommonProperties(sampleNo, experiment, dataSnQDDJ3D, "水泥", cementQdcd.getKzqdsy3d().getJcrq(), judgeGist, experimentGist);

                    }
                    //抗压强度3d
                    if (cementQdcd.getKyqdsy3d() != null) {
                        if (cementQdcd.getKyqdsy3d().getDxjl() != null && !cementQdcd.getKyqdsy3d().getDxjl().isEmpty()) {
                            dataSnQDDJ3D.setConclusion2(cementQdcd.getKyqdsy3d().getDxjl());
                        }
                        if (cementQdcd.getKyqdsy3d().getKyqdsyInfo() != null) {
                            int con = 1;
                            for (CementQdcd.KyqdsyInfo kyqdsyInfo : cementQdcd.getKyqdsy3d().getKyqdsyInfo()) {
                                if (con == 1) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ3D.setS5(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ3D.setS6(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 2) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ3D.setS7(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ3D.setS8(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 3) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ3D.setS9(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ3D.setS10(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 4) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ3D.setS11(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ3D.setS12(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 5) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ3D.setS13(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ3D.setS14(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 6) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ3D.setS15(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ3D.setS16(kyqdsyInfo.getKyqd());
                                    }
                                }
                                con++;
                            }
                        }
                        if (cementQdcd.getKyqdsy3d().getPjz() != null && !cementQdcd.getKyqdsy3d().getPjz().isEmpty()) {
                            dataSnQDDJ3D.setS17(cementQdcd.getKzqdsy3d().getPjz());
                        }
                    }


                    if (experiment.getMaterialsSpecs() != null && !experiment.getMaterialsSpecs().isEmpty()) {
                        CementAdventEnum cementAdventEnum = CementAdventEnum.selectByCode(experiment.getMaterialsSpecs());
                        String[] split = cementAdventEnum.getName().split(",");
                        dataSnQDDJ3D.setST1(split[0]);
                        dataSnQDDJ3D.setST2(split[1]);
                    }


                    //根据样品编码查询水泥协会抗压 抗折 3d
                    Map<String, Object> data_jgcl_sn_qddj3DBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_QDDJ3DBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥协会抗压 抗折 3d
                    if (data_jgcl_sn_qddj3DBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_QDDJ3D(dataSnQDDJ3D);
                    } else {
                        //修改水泥协会抗压 抗折 3d
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_QDDJ3D(dataSnQDDJ3D);
                    }

                }


                //创建协会水泥抗压强度28d对象
                DataSnQDDJ28D dataSnQDDJ28D = new DataSnQDDJ28D();


                if (cementQdcd != null) {
                    //抗折强度28d
                    if (cementQdcd.getKzqdsy28d() != null) {
                        if (cementQdcd.getKzqdsy28d().getDxjl() != null && !cementQdcd.getKzqdsy28d().getDxjl().isEmpty()) {
                            dataSnQDDJ28D.setConclusion(cementQdcd.getKzqdsy28d().getDxjl());
                        }
                        if (cementQdcd.getKzqdsy28d().getKzqdsyInfo() != null) {
                            int con = 1;
                            for (CementQdcd.KzqdsyInfo kzqdsyInfo : cementQdcd.getKzqdsy28d().getKzqdsyInfo()) {
                                if (con == 1) {
                                    if (kzqdsyInfo.getKzqd() != null && !kzqdsyInfo.getKzqd().isEmpty()) {
                                        dataSnQDDJ28D.setS1(kzqdsyInfo.getKzqd());
                                    }
                                } else if (con == 2) {
                                    if (kzqdsyInfo.getKzqd() != null && !kzqdsyInfo.getKzqd().isEmpty()) {
                                        dataSnQDDJ28D.setS2(kzqdsyInfo.getKzqd());
                                    }
                                } else if (con == 3) {
                                    if (kzqdsyInfo.getKzqd() != null && !kzqdsyInfo.getKzqd().isEmpty()) {
                                        dataSnQDDJ28D.setS3(kzqdsyInfo.getKzqd());
                                    }
                                }
                                con++;
                            }
                        }
                        if (cementQdcd.getKzqdsy28d().getPjz() != null && !cementQdcd.getKzqdsy28d().getPjz().isEmpty()) {
                            dataSnQDDJ28D.setS3(cementQdcd.getKzqdsy28d().getPjz());
                        }

                        //设置公共属性
                        setCommonProperties(sampleNo, experiment, dataSnQDDJ3D, "水泥", cementQdcd.getKzqdsy3d().getJcrq(), judgeGist, experimentGist);

                    }
                    //抗压强度28d
                    if (cementQdcd.getKyqdsy28d() != null) {
                        if (cementQdcd.getKyqdsy28d().getDxjl() != null && !cementQdcd.getKyqdsy28d().getDxjl().isEmpty()) {
                            dataSnQDDJ28D.setConclusion2(cementQdcd.getKyqdsy28d().getDxjl());
                        }
                        if (cementQdcd.getKyqdsy28d().getKyqdsyInfo() != null) {
                            int con = 1;
                            for (CementQdcd.KyqdsyInfo kyqdsyInfo : cementQdcd.getKyqdsy28d().getKyqdsyInfo()) {
                                if (con == 1) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ28D.setS5(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ28D.setS6(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 2) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ28D.setS7(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ28D.setS8(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 3) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ28D.setS9(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ28D.setS10(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 4) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ28D.setS11(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ28D.setS12(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 5) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ28D.setS13(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ28D.setS14(kyqdsyInfo.getKyqd());
                                    }
                                } else if (con == 6) {
                                    if (kyqdsyInfo.getHz() != null && !kyqdsyInfo.getHz().isEmpty()) {
                                        dataSnQDDJ28D.setS15(kyqdsyInfo.getHz());
                                    }
                                    if (kyqdsyInfo.getKyqd() != null && !kyqdsyInfo.getKyqd().isEmpty()) {
                                        dataSnQDDJ28D.setS16(kyqdsyInfo.getKyqd());
                                    }
                                }
                                con++;
                            }
                        }
                        if (cementQdcd.getKyqdsy28d().getPjz() != null && !cementQdcd.getKyqdsy28d().getPjz().isEmpty()) {
                            dataSnQDDJ28D.setS17(cementQdcd.getKyqdsy28d().getPjz());
                        }
                    }


                    //获取标准值
                    if (experiment.getMaterialsSpecs() != null && !experiment.getMaterialsSpecs().isEmpty()) {
                        CementAdventEnum cementAdventEnum = CementAdventEnum.selectByCode(experiment.getMaterialsSpecs());
                        String[] split = cementAdventEnum.getName2().split(",");
                        dataSnQDDJ28D.setST1(split[0]);
                        dataSnQDDJ28D.setST2(split[1]);
                    }


                    //根据样品编码查询水泥协会抗压 抗折 28d
                    Map<String, Object> data_jgcl_sn_qddj3DBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_QDDJ3DBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥协会抗压 抗折 28d
                    if (data_jgcl_sn_qddj3DBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_QDDJ3D(dataSnQDDJ3D);
                    } else {
                        //修改水泥协会抗压 抗折 28d
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_QDDJ3D(dataSnQDDJ3D);
                    }

                }*/
                //水泥 细度
            } else if (detail.getTestProjectCode().equals(CementEnum.XD.getTestProjectType())) {
                CementXd cementXd = JsonUtils.getObject(objJson, CementXd.class);

                DataSnXd dataSnXd = new DataSnXd();

                if (cementXd != null) {
                    dataSnXd.setS11(NullUtils.ifNull(cementXd.getPjz()));
                    dataSnXd.setS10(NullUtils.ifNull(cementXd.getXzxs()));
                    dataSnXd.setConclusion(NullUtils.ifNull(cementXd.getSfhg()));
                    dataSnXd.setSt1(NullUtils.ifNull(cementXd.getSt1()));
                    int con = 1;
                    for (CementXd.Fysff fysff : cementXd.getFysff()) {
                        if (con == 1) {
                            dataSnXd.setS1(NullUtils.ifNull(fysff.getClz()));
                            dataSnXd.setS2(NullUtils.ifNull(fysff.getSyl()));
                            dataSnXd.setS3(NullUtils.ifNull(fysff.getSylv()));
                        } else if (con == 2) {
                            dataSnXd.setS4(NullUtils.ifNull(fysff.getClz()));
                            dataSnXd.setS5(NullUtils.ifNull(fysff.getSyl()));
                            dataSnXd.setS6(NullUtils.ifNull(fysff.getSylv()));
                        } else if (con == 3) {
                            dataSnXd.setS7(NullUtils.ifNull(fysff.getClz()));
                            dataSnXd.setS8(NullUtils.ifNull(fysff.getSyl()));
                            dataSnXd.setS9(NullUtils.ifNull(fysff.getSylv()));
                        }
                        con++;
                    }

                    dataSnXd.setFangKongShaiGuiGe(cementXd.getFksgg());//默认写死80

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_XD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSnXd, "水泥", cementXd.getJcrq(), detail);

                    //根据样品编码查询水泥细度
                    DataSnXd data_jgcl_sn_bzcdnjsjBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_XD_SXFBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥标准稠度与初凝时间
                    if (data_jgcl_sn_bzcdnjsjBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_XD_SXF(dataSnXd);
                    } else {
                        //修改水泥标准稠度与初凝时间
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_XD_SXF(dataSnXd);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = cementXd.getJcrq();

                        defaultUc.setConclusion(cementXd.getSfhg());
                        defaultUc.setUcResultValue(cementXd.getSfhg());
                        defaultUc.setUcTestValue(cementXd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_XD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CEMENT_PARAM_XD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "xd");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "水泥检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }

                //水泥 密度
            } else if (detail.getTestProjectCode().equals(CementEnum.MD.getTestProjectType())) {
                CementMd cementMd = JsonUtils.getObject(objJson, CementMd.class);

                DataSnBbmj dataSnBbmj = new DataSnBbmj();

                if (cementMd != null) {
                    dataSnBbmj.setS25(NullUtils.ifNull(cementMd.getPjz()));
                    dataSnBbmj.setConclusion(NullUtils.ifNull(cementMd.getDxjl()));
                    int con = 1;
                    for (CementMd.Dycsy dycsy : cementMd.getDycsy()) {
                        if (con == 1) {
                            dataSnBbmj.setS4(NullUtils.ifNull(dycsy.getJcjg()));
                        } else if (con == 2) {
                            dataSnBbmj.setS16(NullUtils.ifNull(dycsy.getJcjg()));
                        }
                        con++;
                    }

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_MD.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSnBbmj, "水泥", cementMd.getJcrq(), detail);

                    //根据样品编码查询水泥密度
                    DataSnBbmj data_jgcl_sn_bzcdnjsjBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_XD_BBMJBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥密度
                    if (data_jgcl_sn_bzcdnjsjBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_XD_BBMJ(dataSnBbmj);
                    } else {
                        //修改水泥密度
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_XD_BBMJ(dataSnBbmj);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = cementMd.getJcrq();

                        defaultUc.setConclusion(cementMd.getDxjl());
                        defaultUc.setUcResultValue(cementMd.getDxjl());
                        defaultUc.setUcTestValue(cementMd.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_MD.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CEMENT_PARAM_MD.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "md");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "水泥检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }

                //比表面积
            } else if (detail.getTestProjectCode().equals(CementEnum.BBMJ.getTestProjectType())) {
                CementBbmj cementBbmj = objJson.toJavaObject(CementBbmj.class);
                DataSnBbmj dataSnBbmj = new DataSnBbmj();
                if (cementBbmj != null) {
                    //todo 水泥重量P(g) 1 未装水泥液面高h1 1 装水泥后液面高h2 1 待确认

                    dataSnBbmj.setS26(NullUtils.ifNull(cementBbmj.getPjz()));
                    /*dataSnBbmj.setS6(NullUtils.ifNull(cementBbmj.getMd()));
                    dataSnBbmj.setS18(NullUtils.ifNull(cementBbmj.getMd()));
                    dataSnBbmj.setS7(NullUtils.ifNull(cementBbmj.getSlckxl()));
                    dataSnBbmj.setS19(NullUtils.ifNull(cementBbmj.getSlckxl()));

                    List<CementBbmj.Bbdycsy> bbdycsy = cementBbmj.getBbdycsy();
                    int con = 1;
                    for (CementBbmj.Bbdycsy bbmj : bbdycsy) {
                        if (con == 1) {
                            dataSnBbmj.setS5(NullUtils.ifNull(bbmj.getBcbbmj()));
                            dataSnBbmj.setS8(NullUtils.ifNull(bbmj.getBcjlsj()));
                            dataSnBbmj.setS9(NullUtils.ifNull(bbmj.getBzkxl()));
                            dataSnBbmj.setS10(NullUtils.ifNull(bbmj.getBzmd()));
                            dataSnBbmj.setS11(NullUtils.ifNull(bbmj.getBzjlsj()));
                            dataSnBbmj.setS12(NullUtils.ifNull(bbmj.getBzbbmj()));
                        } else if (con == 2) {
                            dataSnBbmj.setS17(NullUtils.ifNull(bbmj.getBcbbmj()));
                            dataSnBbmj.setS20(NullUtils.ifNull(bbmj.getBcjlsj()));
                            dataSnBbmj.setS21(NullUtils.ifNull(bbmj.getBzkxl()));
                            dataSnBbmj.setS22(NullUtils.ifNull(bbmj.getBzmd()));
                            dataSnBbmj.setS23(NullUtils.ifNull(bbmj.getBzjlsj()));
                            dataSnBbmj.setS24(NullUtils.ifNull(bbmj.getBzbbmj()));
                        }
                        con++;
                    }*/

                    //判断依据
                    String judgeGist = "";
                    //试验依据
                    String experimentGist = "";
                    //获取标准值
                    for (CheckBatchConfig projectInfo : batchConfigList) {
                        if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_BBMJ.getCode())) {
                            judgeGist = projectInfo.getJudgeGist();
                            experimentGist = projectInfo.getExperimentGist();
                        }
                    }

                    //设置公共属性
                    setCommonProperties(sampleNo, experiment, dataSnBbmj, "水泥", cementBbmj.getJcrq(), detail);

                    //根据样品编码查询水泥比表面积
                    DataSnBbmj data_jgcl_sn_bzcdnjsjBySampleNo = m_cementLaboratoryMapper.findDATA_JGCL_SN_XD_BBMJBySampleNo(sampleNo);
                    //查询没值说明需要  新增水泥比表面积
                    if (data_jgcl_sn_bzcdnjsjBySampleNo == null) {
                        m_cementLaboratoryMapper.addDATA_JGCL_SN_XD_BBMJ(dataSnBbmj);
                    } else {
                        //修改水泥比表面积
                        m_cementLaboratoryMapper.updateDATA_JGCL_SN_XD_BBMJ(dataSnBbmj);
                    }


                    //赋值dateDefalutUC
                    //存储协会需要做的项目集合
                    Set<String> set = new HashSet<>();

                    for (TestProjectInfo testProjectInfo : testProjectInfoList) {
                        if (detail.getTestProjectCode() != null && testProjectInfo.getTestCode() != null && testProjectInfo.getTestCode().equals(detail.getTestProjectCode())) {
                            if (testProjectInfo.getParameterName() != null && !testProjectInfo.getParameterName().isEmpty()) {
                                //添加进协会需要做的项目集合
                                set.addAll(Arrays.asList(testProjectInfo.getParameterName().split(",")));
                            }
                        }
                    }

                    for (String str : set) {
                        DataDefaultUc defaultUc = new DataDefaultUc();

                        Map<String, Object> itemParameter = m_uploadLaboratoryMapper.findItemParameter(str, samId);

                        if (itemParameter == null || itemParameter.get("ParameterID") == null) {
                            log.error("未查询到对应的材料：value = " + str + "SampleID =" + samId);
                            continue;
                        }
                        String parameterID = itemParameter.get("ParameterID").toString();

                        String jcrq = null;

                        jcrq = cementBbmj.getJcrq();

                        defaultUc.setConclusion(cementBbmj.getDxjl());
                        defaultUc.setUcResultValue(cementBbmj.getDxjl());
                        defaultUc.setUcTestValue(cementBbmj.getPjz());


                        //获取标准值
                        for (CheckBatchConfig projectInfo : batchConfigList) {
                            if (projectInfo.getTestProjectCode() != null && projectInfo.getTestProjectCode().equals(TestProjectEnum.CEMENT_PARAM_BBMJ.getCode())) {
                                judgeGist = projectInfo.getJudgeGist();
                                experimentGist = projectInfo.getExperimentGist();
                                defaultUc.setUcUnit(NullUtils.ifNull(projectInfo.getCheckValueUnit()));
                            }
                        }


                        //根据物料信息设置判断配置
                        for (TestProjectSpecConfig test : testProjectSpecConfigList) {
                            if (TestProjectEnum.CEMENT_PARAM_BBMJ.getCode().equals(test.getTestProjectCode())) {
                                if (experiment.getMaterialsName() != null && experiment.getMaterialsSpecs() != null && experiment.getMaterialsName().equals(test.getMaterialsName()) && experiment.getMaterialsSpecs().equals(test.getMaterialsSpec())) {
                                    String json = test.getObjJson();
                                    setUcStandardValue(defaultUc, json, "bbmj");
                                }
                            }
                        }


                        //赋值
                        setDefUc(defaultUc, experiment, "水泥检测室", sampleNo, jcrq, detail);

                        defaultUc.setUcParameterID(parameterID);//项目id

                        //新增或修改DataDefaultUc
                        insertOrUpdateDataDefaultUc(sampleNo, parameterID, defaultUc);

                    }
                }
            }
        }
    }

    //设置公共属性值
    private void setCommonProperties(String sampleNo, Experiment experiment, BaseData baseData, String detectonPlace, String jcrq, ExperimentDetail detail) {
        baseData.setSampleNo(sampleNo);
        baseData.setSampleName(experiment.getMaterialsName());
        //检测设备
        String equipment = "";
        if (detail.getEquipment() != null && !detail.getEquipment().isEmpty()) {
            for (String val : experiment.getEquipment().split(",")) {
                equipment += val + ";";
            }
        }
        baseData.setEquipment(equipment);
        baseData.setTemperature(detail.getTemperature());
        baseData.setHumidity(detail.getHumidness());
        baseData.setDetectonRuleCode(detail.getExperimentGist());
        baseData.setAccessRuleCode(detail.getJudgeGist());
        baseData.setDetectonPlace(detectonPlace);

        Date date = null;
        if (StringUtils.isBlank(jcrq)) {
            date = new Date();
        } else {
            date = DateHelper.parseDateTime(DateHelper.getDefaultDateFormat(), DateHelper.getDefaultLocal(), jcrq);
        }
        if (date == null) {
            log.error("检测日期转换错误。。。" + jcrq);
            throw new RuntimeException("检测日期转换错误。。。" + jcrq);
        }
        baseData.setDetectonDate(date);
        baseData.setDetectonMan(experiment.getSocietyUserName());
        baseData.setUploadFlag(UploadFlagUtils.CtoGB_Num(sampleNo, "z", baseData.getDetectonDate(), null));

    }


    //设置defuc值
    private void setDefUc(DataDefaultUc defaultUc, Experiment experiment, String detectonPlace, String sampleNo, String jcrq, ExperimentDetail detail) {
        defaultUc.setSampleNo(sampleNo);
        defaultUc.setSampleName(experiment.getMaterialsName());
        //检测设备
        String equipment = "";
        if (detail.getEquipment() != null && !detail.getEquipment().isEmpty()) {
            for (String val : experiment.getEquipment().split(",")) {
                equipment += val + ";";
            }
        }
        defaultUc.setEquipment(equipment);
        defaultUc.setTemperature(detail.getTemperature());
        defaultUc.setHumidity(detail.getHumidness());
        defaultUc.setDetectonRuleCode(detail.getExperimentGist());
        defaultUc.setAccessRuleCode(detail.getJudgeGist());
        defaultUc.setDetectonPlace(detectonPlace);

        Date date = null;
        if (StringUtils.isBlank(jcrq)) {
            //如果为空 则默认当前日期
            date = new Date();
        } else {
            date = DateHelper.parseDateTime(DateHelper.getDefaultDateFormat(), DateHelper.getDefaultLocal(), jcrq);
        }


        if (date == null) {
            log.error("检测日期转换错误。。。" + jcrq);
            throw new RuntimeException("检测日期转换错误。。。" + jcrq);
        }

        defaultUc.setDetectonDate(date);
        defaultUc.setDetectonMan(experiment.getSocietyUserName());
        defaultUc.setUploadFlag(UploadFlagUtils.CtoGB_Num(sampleNo, "z", defaultUc.getDetectonDate(), null));
        defaultUc.setDetectonManLoginType("0");
        defaultUc.setUCSampleRegular("1");
    }

    public void setUcStandardValue(DataDefaultUc defaultUc, String json, String value) {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            JsonNode rootNode = objectMapper.readTree(json);
            if (rootNode != null) {
                JsonNode bbmjNode = rootNode.get(value);
                if (bbmjNode != null) {
                    boolean isNotContainMax = false;
                    boolean isNotContainMin = false;
                    String min = null;
                    String max = null;
                    if (bbmjNode.get("isNotContainMax") != null && "true".equals(bbmjNode.get("isNotContainMax").toString())) {
                        isNotContainMax = true;
                    }
                    if (bbmjNode.get("isNotContainMin") != null && "true".equals(bbmjNode.get("isNotContainMin").toString())) {
                        isNotContainMin = true;
                    }
                    if (bbmjNode.get("min") != null && StringUtils.isNotEmpty(bbmjNode.get("min").toString()) && !"null".equals(bbmjNode.get("min").toString())) {
                        min = bbmjNode.get("min").toString();
                    }
                    if (bbmjNode.get("max") != null && StringUtils.isNotEmpty(bbmjNode.get("max").toString()) && !"null".equals(bbmjNode.get("max").toString())) {
                        max = bbmjNode.get("max").toString();
                    }
                    String val = "";
                    if (min != null && max != null) {
                        if (isNotContainMin) {
                            val = val + ">" + min;
                        } else {
                            val = val + "≥" + min;
                        }

                        if (isNotContainMax) {
                            val = val + "<" + max;
                        } else {
                            val = val + "≤" + max;
                        }
                    } else if (min != null) {
                        if (isNotContainMin) {
                            val = val + ">" + min;
                        } else {
                            val = val + "≥" + min;
                        }
                    } else if (max != null) {
                        if (isNotContainMax) {
                            val = val + "<" + max;
                        } else {
                            val = val + "≤" + max;
                        }
                    }

                    if (!val.isEmpty()) {
                        defaultUc.setUcStandardValue(val);
                    }
                }
            }
        } catch (IOException e) {
            log.error(e.getMessage());
        }
    }

    private void insertOrUpdateDataDefaultUc(String sampleNo, String parameterID, DataDefaultUc defaultUc) {
        //查询data_defalutUc 是否存在
        Map<String, Object> data_defaultUCBySampleNo = dataDefUcLaboratoryMapper.findDATA_DefaultUCBySampleNo(sampleNo, parameterID);
        if (data_defaultUCBySampleNo == null) {
            //新增
            dataDefUcLaboratoryMapper.addDATA_DefaultUC(defaultUc);
        } else {
            //修改
            dataDefUcLaboratoryMapper.updateDATA_DefaultUC(defaultUc);
        }

    }

    public static String stringToDoubleAndDivide(String str) {
        try {
            if (org.apache.commons.lang.StringUtils.isBlank(str)) {
                return "";
            }
            double value = Double.parseDouble(str);
            double dou = value / 1000;
            DecimalFormat df = new DecimalFormat("0.000");
            String format = df.format(dou);
            return format;
        } catch (NumberFormatException e) {
            log.info("输入的字符串无法转换为 double 类型。str :" + str);
            return "";
        }
    }

    public static int stringToIntRounding(String s) {
        try {
            BigDecimal bd = new BigDecimal(s);
            bd = bd.setScale(0, BigDecimal.ROUND_HALF_UP);
            return bd.intValue();
        } catch (NumberFormatException e) {
            System.out.println("输入的字符串无法转换为数字：" + s);
            return 0;
        }
    }
}
